forked from duckdb/duckdb-spatial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspatial_join_logical.hpp
More file actions
63 lines (46 loc) · 1.79 KB
/
Copy pathspatial_join_logical.hpp
File metadata and controls
63 lines (46 loc) · 1.79 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
#pragma once
#include "duckdb/planner/operator/logical_extension_operator.hpp"
namespace duckdb {
class LogicalSpatialJoin final : public LogicalExtensionOperator {
public:
static constexpr auto TYPE = LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR;
static constexpr auto OPERATOR_TYPE_NAME = "logical_spatial_join";
public:
//! The type of the join (INNER, OUTER, etc...)
JoinType join_type;
//! Table index used to refer to the MARK column (in case of a MARK join)
idx_t mark_index {};
//! The spatial predicate of the join
unique_ptr<Expression> spatial_predicate;
//! Extra conditions to be applied after the join, e.g. for filtering
vector<unique_ptr<Expression>> extra_conditions;
//! The columns of the LHS that are output by the join
vector<idx_t> left_projection_map;
//! The columns of the RHS that are output by the join
vector<idx_t> right_projection_map;
//! Join Keys statistics (optional)
vector<unique_ptr<BaseStatistics>> join_stats;
bool has_const_distance = false;
double const_distance = 0.0;
public:
explicit LogicalSpatialJoin(JoinType join_type_p);
vector<ColumnBinding> GetColumnBindings() override;
void ResolveColumnBindings(ColumnBindingResolver &res, vector<ColumnBinding> &bindings) override;
bool HasProjectionMap() const override {
return !left_projection_map.empty() || !right_projection_map.empty();
}
PhysicalOperator &CreatePlan(ClientContext &context, PhysicalPlanGenerator &generator) override;
public:
void Serialize(Serializer &serializer) const override;
static unique_ptr<LogicalExtensionOperator> Deserialize(Deserializer &reader);
public:
string GetName() const override {
return "SPATIAL_JOIN";
}
string GetExtensionName() const override {
return "duckdb_spatial";
}
protected:
void ResolveTypes() override;
};
} // namespace duckdb