80 inline static Entry<int64_t> kBatchSize{
"read.batch-size", 4096};
87 inline static Entry<bool> kArrowUseLargeList{
"read.arrow.use-large-list",
false};
90 inline static Entry<bool> kArrowValidateBatch{
"read.arrow.validate-batch",
true};
92 inline static Entry<bool> kParquetRowGroupFilter{
93 "read.parquet.row-group-filter.enabled",
true};
97 inline static Entry<bool> kAvroSkipDatum{
"read.avro.skip-datum",
true};
99 inline static Entry<int64_t> kAvroBufferSize{
"read.avro.buffer-size", 1024 * 1024};
103 const std::unordered_map<std::string, std::string>& properties);
115 std::shared_ptr<class FileIO>
io;
120 std::shared_ptr<class Expression>
filter;
122 bool case_sensitive =
true;
Definition file_reader.h:74
static ReaderProperties FromMap(const std::unordered_map< std::string, std::string > &properties)
Create a ReaderProperties instance from a map of key-value pairs.
Base reader class to read data from different file formats.
Definition file_reader.h:39
virtual Result< std::optional< ArrowArray > > Next()=0
Read next data from file.
virtual Result< ArrowSchema > Schema()=0
Get the schema of the data. Every batch must match this schema and the configured Arrow list width....
virtual Result< std::unordered_map< std::string, std::string > > Metadata()=0
Get the metadata of the file.
virtual Status Open(const ReaderOptions &options)=0
Open the reader.
virtual Status Close()=0
Close the reader.
Definition expected.h:1199
Provide typed configuration helpers.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:34
std::function< Result< std::unique_ptr< Reader > >()> ReaderFactory
Factory function to create a reader of a specific file format.
Definition file_reader.h:135
Define Result, Status, and error helpers.
Registry of reader factories for different file formats.
Definition file_reader.h:138
static ReaderFactory & GetFactory(FileFormatType format_type)
Get the factory function for a specific file format.
static Result< std::unique_ptr< Reader > > Open(FileFormatType format_type, const ReaderOptions &options)
Open a reader for a specific file format.
ReaderFactoryRegistry(FileFormatType format_type, ReaderFactory factory)
Register a factory function for a specific file format.
Options for creating a reader.
Definition file_reader.h:107
std::optional< int64_t > data_sequence_number
Data sequence number inherited by the manifest entry, if assigned.
Definition file_reader.h:129
std::shared_ptr< class Schema > projection
The projection schema to read from the file. This field is required.
Definition file_reader.h:117
std::shared_ptr< class FileIO > io
FileIO instance to open the file.
Definition file_reader.h:115
std::optional< size_t > length
The total length of the file.
Definition file_reader.h:111
std::string path
The path to the file to read.
Definition file_reader.h:109
std::shared_ptr< class NameMapping > name_mapping
Name mapping for schema evolution compatibility. Used when reading files that may have different fiel...
Definition file_reader.h:125
std::optional< int64_t > first_row_id
First row ID inherited by the data file, if assigned.
Definition file_reader.h:127
ReaderProperties properties
Format-specific or implementation-specific properties.
Definition file_reader.h:131
std::optional< Split > split
The split to read.
Definition file_reader.h:113
std::shared_ptr< class Expression > filter
The filter to apply to the data. Reader implementations may ignore this if the file format does not s...
Definition file_reader.h:120
A split of the file to read.
Definition file_reader.h:67
size_t offset
The offset of the split.
Definition file_reader.h:69
size_t length
The length of the split.
Definition file_reader.h:71