78 inline static Entry<int64_t> kBatchSize{
"read.batch-size", 4096};
82 inline static Entry<bool> kAvroSkipDatum{
"read.avro.skip-datum",
true};
84 inline static Entry<int64_t> kAvroBufferSize{
"read.avro.buffer-size", 1024 * 1024};
88 const std::unordered_map<std::string, std::string>& properties);
100 std::shared_ptr<class FileIO>
io;
105 std::shared_ptr<class Expression>
filter;
Definition file_reader.h:72
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.
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.
Provide typed configuration helpers.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
std::function< Result< std::unique_ptr< Reader > >()> ReaderFactory
Factory function to create a reader of a specific file format.
Definition file_reader.h:118
Define Result, Status, and error helpers.
Registry of reader factories for different file formats.
Definition file_reader.h:121
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:92
std::optional< int64_t > data_sequence_number
Data sequence number inherited by the manifest entry, if assigned.
Definition file_reader.h:112
std::shared_ptr< class Schema > projection
The projection schema to read from the file. This field is required.
Definition file_reader.h:102
std::shared_ptr< class FileIO > io
FileIO instance to open the file.
Definition file_reader.h:100
std::optional< size_t > length
The total length of the file.
Definition file_reader.h:96
std::string path
The path to the file to read.
Definition file_reader.h:94
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:108
std::optional< int64_t > first_row_id
First row ID inherited by the data file, if assigned.
Definition file_reader.h:110
ReaderProperties properties
Format-specific or implementation-specific properties.
Definition file_reader.h:114
std::optional< Split > split
The split to read.
Definition file_reader.h:98
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:105
A split of the file to read.
Definition file_reader.h:65
size_t offset
The offset of the split.
Definition file_reader.h:67
size_t length
The length of the split.
Definition file_reader.h:69