iceberg-cpp
Loading...
Searching...
No Matches
projections.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
27#include "iceberg/iceberg_export.h"
28#include "iceberg/result.h"
29#include "iceberg/type_fwd.h"
30
31namespace iceberg {
32
35class ICEBERG_EXPORT ProjectionEvaluator {
36 public:
38
43 Result<std::shared_ptr<Expression>> Project(const std::shared_ptr<Expression>& expr);
44
45 private:
46 friend class Projections;
47
51 explicit ProjectionEvaluator(std::unique_ptr<class ProjectionVisitor> visitor);
52
53 std::unique_ptr<ProjectionVisitor> visitor_;
54};
55
65struct ICEBERG_EXPORT Projections {
81 static std::unique_ptr<ProjectionEvaluator> Inclusive(const PartitionSpec& spec,
82 const Schema& schema,
83 bool case_sensitive = true);
84
100 static std::unique_ptr<ProjectionEvaluator> Strict(const PartitionSpec& spec,
101 const Schema& schema,
102 bool case_sensitive = true);
103};
104
105} // namespace iceberg
A partition spec for a Table.
Definition partition_spec.h:47
A class that projects expressions for a table's data rows into expressions on the table's partition v...
Definition projections.h:35
A schema for a Table.
Definition schema.h:49
Utils to project expressions on rows to expressions on partitions.
Definition projections.h:65