iceberg-cpp
Loading...
Searching...
No Matches
residual_evaluator.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
47class ICEBERG_EXPORT ResidualEvaluator {
48 public:
53 static Result<std::unique_ptr<ResidualEvaluator>> Unpartitioned(
54 std::shared_ptr<Expression> expr);
55
63 static Result<std::unique_ptr<ResidualEvaluator>> Make(std::shared_ptr<Expression> expr,
64 const PartitionSpec& spec,
65 const Schema& schema,
66 bool case_sensitive = true);
67
69
74 virtual Result<std::shared_ptr<Expression>> ResidualFor(
75 const StructLike& partition_data) const;
76
77 protected:
78 ResidualEvaluator(std::shared_ptr<Expression> expr, const PartitionSpec& spec,
79 const Schema& schema, bool case_sensitive);
80
81 std::shared_ptr<Expression> expr_;
82
83 private:
84 const PartitionSpec& spec_;
85 const Schema& schema_;
86 bool case_sensitive_;
87};
88
89} // namespace iceberg
A partition spec for a Table.
Definition partition_spec.h:47
Finds the residuals for an Expression using the partitions in the given PartitionSpec.
Definition residual_evaluator.h:47
A schema for a Table.
Definition schema.h:49
An immutable struct-like wrapper.
Definition struct_like.h:62