iceberg-cpp
Loading...
Searching...
No Matches
refs_table.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 <cstdint>
26#include <memory>
27
32#include "iceberg/result.h"
33#include "iceberg/type_fwd.h"
34
35namespace iceberg {
36
38class ICEBERG_EXPORT RefsTable : public MetadataTable {
39 public:
40 static Result<std::unique_ptr<RefsTable>> Make(std::shared_ptr<const Table> table);
41
43 static const std::shared_ptr<Schema>& CanonicalSchema();
44
45 ~RefsTable() override;
46
47 MetadataTableKind kind() const noexcept override { return MetadataTableKind::kRefs; }
48
49 const std::shared_ptr<Schema>& schema() const override;
50
51 protected:
53 internal::MetadataScanContext context) const override;
54
55 private:
56 friend class MetadataScanTaskReader;
57
58 static Result<ArrowArrayStream> ReadRows(
59 std::shared_ptr<const TableMetadata> metadata,
60 const std::shared_ptr<Schema>& projected_schema, int64_t batch_size);
61
62 explicit RefsTable(std::shared_ptr<const Table> table);
63};
64
66class ICEBERG_EXPORT RefsScan final : public MetadataScan {
67 public:
70
71 ~RefsScan() override;
72
74
75 private:
76 RefsScan(internal::MetadataScanContext context, std::shared_ptr<MetadataScanTask> task);
77
78 const std::shared_ptr<MetadataScanTask> task_;
79};
80
81} // namespace iceberg
Opens metadata scan tasks as Arrow streams.
Definition metadata_scan_task_reader.h:33
A metadata scan that plans tasks or reads all of them as Arrow batches.
Definition metadata_scan.h:107
A metadata table backed by a source Iceberg table.
Definition metadata_table.h:60
Scan the refs metadata captured from a table.
Definition refs_table.h:66
static Result< std::unique_ptr< RefsScan > > Make(internal::MetadataScanContext context)
Create a scan from captured metadata table settings.
Result< MetadataScanTaskStreamPtr > PlanTasksStream() const override
Return a fresh task stream; consuming it may report planning errors.
Refs metadata table.
Definition refs_table.h:38
Result< std::unique_ptr< MetadataScan > > MakeScan(internal::MetadataScanContext context) const override
Plan a scan using the captured metadata, projection, and snapshot selection.
const std::shared_ptr< Schema > & schema() const override
Return the complete canonical schema of this metadata table.
MetadataTableKind kind() const noexcept override
Return this metadata table's kind.
Definition refs_table.h:47
static const std::shared_ptr< Schema > & CanonicalSchema()
Return the canonical schema of the refs metadata table.
Definition expected.h:1199
Define symbol visibility macros for core Iceberg APIs.
Configure metadata scans, plan reusable tasks, and read Arrow batches.
Metadata table factories, schemas, and scan entry points.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:34
MetadataTableKind
Iceberg metadata tables exposed by Table::Inspect().
Definition metadata_table.h:40
Define Result, Status, and error helpers.
Captured metadata and logical settings shared by a builder and its scans.
Definition metadata_scan.h:46