forked from alibaba/paimon-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_visitor.h
More file actions
78 lines (60 loc) · 2.97 KB
/
Copy pathfunction_visitor.h
File metadata and controls
78 lines (60 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Copyright 2024-present Alibaba Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <string>
#include <vector>
#include "paimon/predicate/leaf_predicate.h"
#include "paimon/predicate/literal.h"
#include "paimon/result.h"
#include "paimon/visibility.h"
namespace paimon {
/// A visitor interface for evaluating filter predicates on indexed columns.
/// @tparam T The result type produced by each visit method (e.g., a file index result or global
/// index result).
template <typename T>
class PAIMON_EXPORT FunctionVisitor {
public:
virtual ~FunctionVisitor() = default;
/// Evaluates the IS NOT NULL predicate on the indexed column.
virtual Result<T> VisitIsNotNull() = 0;
/// Evaluates the IS NULL predicate on the indexed column.
virtual Result<T> VisitIsNull() = 0;
/// Evaluates the equality (==) predicate against the given literal.
virtual Result<T> VisitEqual(const Literal& literal) = 0;
/// Evaluates the inequality (!=) predicate against the given literal.
virtual Result<T> VisitNotEqual(const Literal& literal) = 0;
/// Evaluates the less-than (<) predicate against the given literal.
virtual Result<T> VisitLessThan(const Literal& literal) = 0;
/// Evaluates the less-than-or-equal (<=) predicate against the given literal.
virtual Result<T> VisitLessOrEqual(const Literal& literal) = 0;
/// Evaluates the greater-than (>) predicate against the given literal.
virtual Result<T> VisitGreaterThan(const Literal& literal) = 0;
/// Evaluates the greater-than-or-equal (>=) predicate against the given literal.
virtual Result<T> VisitGreaterOrEqual(const Literal& literal) = 0;
/// Evaluates the IN predicate against a list of literals.
virtual Result<T> VisitIn(const std::vector<Literal>& literals) = 0;
/// Evaluates the NOT IN predicate against a list of literals.
virtual Result<T> VisitNotIn(const std::vector<Literal>& literals) = 0;
/// Evaluates whether string values start with the given prefix.
virtual Result<T> VisitStartsWith(const Literal& prefix) = 0;
/// Evaluates whether string values end with the given prefix.
virtual Result<T> VisitEndsWith(const Literal& suffix) = 0;
/// Evaluates whether string values contain the given substring.
virtual Result<T> VisitContains(const Literal& literal) = 0;
/// Evaluates whether string values like the given string.
virtual Result<T> VisitLike(const Literal& literal) = 0;
};
} // namespace paimon