iceberg-cpp
Loading...
Searching...
No Matches
file_scan_task_reader.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <memory>
26#include <string>
27#include <unordered_map>
28#include <vector>
29
31#include "iceberg/iceberg_data_export.h"
32#include "iceberg/result.h"
33#include "iceberg/type_fwd.h"
34
35namespace iceberg {
36
45class ICEBERG_DATA_EXPORT FileScanTaskReader {
46 public:
48 struct Options {
50 std::shared_ptr<FileIO> io;
52 std::shared_ptr<Schema> table_schema;
54 std::vector<std::shared_ptr<Schema>> schemas;
57 std::shared_ptr<Schema> projected_schema;
59 std::shared_ptr<NameMapping> name_mapping;
61 std::unordered_map<std::string, std::string> properties;
62 };
63
65 static Result<std::unique_ptr<FileScanTaskReader>> Make(Options options);
66
68
70 Result<ArrowArrayStream> Open(const FileScanTask& task);
71
73 FileScanTaskReader& operator=(const FileScanTaskReader&) = delete;
74
75 private:
76 class Impl;
77 explicit FileScanTaskReader(std::unique_ptr<Impl> impl);
78 std::unique_ptr<Impl> impl_;
79};
80
81} // namespace iceberg
Definition file_scan_task_reader.cc:136
Opens a FileScanTask as an ArrowArrayStream.
Definition file_scan_task_reader.h:45
Task representing a data file and its corresponding delete files.
Definition table_scan.h:63
Options shared by all tasks opened by this reader.
Definition file_scan_task_reader.h:48
std::shared_ptr< Schema > projected_schema
Definition file_scan_task_reader.h:57
std::shared_ptr< NameMapping > name_mapping
Optional name mapping for files written without field IDs.
Definition file_scan_task_reader.h:59
std::shared_ptr< Schema > table_schema
The table schema. Used as the primary field lookup for delete file resolution.
Definition file_scan_task_reader.h:52
std::vector< std::shared_ptr< Schema > > schemas
Optional list of historical table schemas for field lookup.
Definition file_scan_task_reader.h:54
std::shared_ptr< FileIO > io
FileIO instance for reading data and delete files.
Definition file_scan_task_reader.h:50
std::unordered_map< std::string, std::string > properties
Format-specific or implementation-specific options for data readers.
Definition file_scan_task_reader.h:61