19 #include <llvm/IR/Value.h>
20 #include <boost/optional.hpp>
47 std::list<std::shared_ptr<Analyzer::Expr>>
quals;
63 return {
false, std::nullopt};
75 "ST_Contains_Polygon_Point"};
77 "ST_Contains_Polygon_Polygon"};
79 "ST_Contains_MultiPolygon_Point"};
81 "ST_Intersects_Point_Polygon"};
83 "ST_Intersects_Point_MultiPolygon"};
85 "ST_Intersects_Polygon_Point"};
87 "ST_Intersects_Polygon_Polygon"};
89 "ST_Intersects_Polygon_MultiPolygon"};
91 "ST_Intersects_MultiPolygon_MultiPolygon"};
93 "ST_Intersects_MultiPolygon_Polygon"};
95 "ST_Intersects_MultiPolygon_Point"};
97 "ST_Approx_Overlaps_MultiPolygon_Point"};
102 "ST_cContains_MultiPolygon_Point"};
104 "ST_cContains_Polygon_Point"};
106 "ST_cIntersects_Polygon_Point"};
108 "ST_cIntersects_MultiPolygon_Point"};
164 static constexpr std::array<std::string_view, 4>
170 static constexpr std::array<std::string_view, 6>
183 [target_func_name](std::string_view func_name) {
184 return target_func_name == func_name;
193 [target_func_name](std::string_view func_name) {
194 return target_func_name == func_name;
202 [target_func_name](std::string_view func_name) {
203 return target_func_name == func_name;
211 [target_func_name](std::string_view func_name) {
212 return target_func_name == func_name;
220 [target_func_name](std::string_view func_name) {
221 return target_func_name == func_name;
229 [target_func_name](std::string_view func_name) {
230 return target_func_name == func_name;
236 const std::shared_ptr<Analyzer::Expr> expr,
237 std::vector<InputDescriptor>
const& input_descs,
238 std::unordered_map<const RelAlgNode*, int>
const& input_to_nest_level,
239 std::vector<size_t>
const& input_permutation,
240 std::list<std::shared_ptr<const InputColDescriptor>>& input_col_desc,
242 Executor
const* executor);
246 std::vector<InputDescriptor>& input_descs,
247 std::unordered_map<const RelAlgNode*, int>& input_to_nest_level,
248 std::vector<size_t>& input_permutation,
249 std::list<std::shared_ptr<const InputColDescriptor>>& input_col_desc,
250 Executor
const* executor);
253 const std::list<std::shared_ptr<Analyzer::Expr>>& quals,
260 const int max_rte_covered);
263 std::unordered_map<int, llvm::Value*>& scan_idx_to_hash_pos);
Defines data structures for the semantic analysis phase of query processing.
Analyzer::ExpressionPtr rewrite_array_elements(Analyzer::Expr const *expr)
static constexpr std::array< std::string_view, 9 > POLY_POINT_REWRITE_TARGET_FUNC
static bool is_point_poly_rewrite_target_func(std::string_view target_func_name)
static constexpr std::string_view ST_INTERSECTS_POLYGON_POINT_sv
std::optional< BoundingBoxIntersectJoinConjunction > converted_bbox_intersect_join_info
std::list< std::shared_ptr< Analyzer::Expr > > join_quals
static constexpr std::array< std::string_view, 6 > ST_INTERSECTS_FORCE_TABLE_REORDERING_TARGET_FUNC
static constexpr std::string_view ST_INTERSECTS_POINT_POLYGON_sv
bool self_join_not_covered_by_left_deep_tree(const Analyzer::ColumnVar *key_side, const Analyzer::ColumnVar *val_side, const int max_rte_covered)
static constexpr std::string_view ST_CONTAINS_POLYGON_POINT_sv
static constexpr std::array< std::string_view, 18 > BBOX_INTERSECT_SUPPORTED_FUNC
static constexpr std::string_view ST_CINTERSECTS_POLYGON_POINT_sv
static constexpr std::string_view ST_DISTANCE_sv
size_t get_table_cardinality(shared::TableKey const &table_key, Executor const *executor)
static bool is_range_join_rewrite_target_func(std::string_view target_func_name)
bool has_bbox_intersect_join
std::shared_ptr< Analyzer::Expr > ExpressionPtr
std::vector< JoinCondition > JoinQualsPerNestingLevel
Analyzer::ExpressionPtr rewrite_expr(const Analyzer::Expr *expr)
std::list< std::shared_ptr< Analyzer::Expr > > strip_join_covered_filter_quals(const std::list< std::shared_ptr< Analyzer::Expr >> &quals, const JoinQualsPerNestingLevel &join_quals)
const int get_max_rte_scan_table(std::unordered_map< int, llvm::Value * > &scan_idx_to_hash_pos)
static constexpr std::array< std::string_view, 2 > POINT_POLY_REWRITE_TARGET_FUNC
static BoundingBoxIntersectJoinTranslationResult createEmptyResult()
JoinQualsPerNestingLevel join_quals
std::list< std::shared_ptr< Analyzer::Expr > > quals
static constexpr std::string_view ST_APPROX_OVERLAPS_MULTIPOLYGON_POINT_sv
static constexpr std::string_view ST_INTERSECTS_MULTIPOLYGON_MULTIPOLYGON_sv
static constexpr std::string_view ST_INTERSECTS_POINT_MULTIPOLYGON_sv
static constexpr std::string_view ST_INTERSECTSBOX_sv
static constexpr std::string_view ST_CCONTAINS_MULTIPOLYGON_POINT_sv
static constexpr std::string_view ST_CINTERSECTS_MULTIPOLYGON_POINT_sv
BoundingBoxIntersectJoinTranslationInfo convert_bbox_intersect_join(JoinQualsPerNestingLevel const &join_quals, std::vector< InputDescriptor > &input_descs, std::unordered_map< const RelAlgNode *, int > &input_to_nest_level, std::vector< size_t > &input_permutation, std::list< std::shared_ptr< const InputColDescriptor >> &input_col_desc, Executor const *executor)
static bool is_bbox_intersect_supported_func(std::string_view target_func_name)
static constexpr std::array< std::string_view, 5 > POLY_MPOLY_REWRITE_TARGET_FUNC
BoundingBoxIntersectJoinTranslationResult translate_bbox_intersect_with_reordering(const std::shared_ptr< Analyzer::Expr > expr, std::vector< InputDescriptor > const &input_descs, std::unordered_map< const RelAlgNode *, int > const &input_to_nest_level, std::vector< size_t > const &input_permutation, std::list< std::shared_ptr< const InputColDescriptor >> &input_col_desc, const BoundingBoxIntersectJoinRewriteType rewrite_type, Executor const *executor)
static constexpr std::string_view ST_INTERSECTS_MULTIPOLYGON_POLYGON_sv
static constexpr std::array< std::string_view, 4 > ST_CONTAIN_FORCE_TABLE_REORDERING_TARGET_FUNC
static constexpr std::array< std::string_view, 5 > MANY_TO_MANY_BBOX_INTERSECT_FUNC
static constexpr std::string_view ST_INTERSECTS_POLYGON_POLYGON_sv
static constexpr std::string_view ST_DWITHIN_POINT_POINT_sv
static bool is_poly_point_rewrite_target_func(std::string_view target_func_name)
static bool is_poly_mpoly_rewrite_target_func(std::string_view target_func_name)
bool any_of(std::vector< Analyzer::Expr * > const &target_exprs)
static constexpr std::string_view ST_CONTAINS_MULTIPOLYGON_POINT_sv
BoundingBoxIntersectJoinRewriteType
Execution unit for relational algebra. It's a low-level description of any relational algebra operati...
static constexpr std::string_view ST_CONTAINS_POLYGON_POLYGON_sv
static constexpr std::string_view ST_INTERSECTS_MULTIPOLYGON_POINT_sv
static bool is_many_to_many_func(std::string_view target_func_name)
std::shared_ptr< Analyzer::Expr > fold_expr(const Analyzer::Expr *expr)
static constexpr std::string_view ST_CCONTAINS_POLYGON_POINT_sv
static constexpr std::string_view ST_INTERSECTS_POLYGON_MULTIPOLYGON_sv
static constexpr std::array< std::string_view, 2 > RANGE_JOIN_REWRITE_TARGET_FUNC