Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::RegexRangeFilter Class Reference

Public Member Functions

unique_ptr< LogicalOperator > Rewrite (unique_ptr< LogicalOperator > op)
 Perform filter pushdown.

Constructor & Destructor Documentation

◆ RegexRangeFilter()

duckdb::RegexRangeFilter::RegexRangeFilter ( )
inline
315290 {
315291 }

Member Function Documentation

◆ Rewrite()

unique_ptr< LogicalOperator > duckdb::RegexRangeFilter::Rewrite ( unique_ptr< LogicalOperator > op)

Perform filter pushdown.

318112 {
318113 for (idx_t child_idx = 0; child_idx < op->children.size(); child_idx++) {
318114 op->children[child_idx] = Rewrite(std::move(op->children[child_idx]));
318115 }
318116
318117 if (op->type != LogicalOperatorType::LOGICAL_FILTER) {
318118 return op;
318119 }
318120
318121 auto new_filter = make_uniq<LogicalFilter>();
318122
318123 for (auto &expr : op->expressions) {
318124 if (expr->GetExpressionType() == ExpressionType::BOUND_FUNCTION) {
318125 auto &func = expr->Cast<BoundFunctionExpression>();
318126 if (func.function.name != "regexp_full_match" || func.children.size() != 2) {
318127 continue;
318128 }
318129 auto &info = func.bind_info->Cast<RegexpMatchesBindData>();
318130 if (!info.range_success) {
318131 continue;
318132 }
318133 auto filter_left = make_uniq<BoundComparisonExpression>(
318134 ExpressionType::COMPARE_GREATERTHANOREQUALTO, func.children[0]->Copy(),
318135 make_uniq<BoundConstantExpression>(Value::BLOB_RAW(info.range_min)));
318136 auto filter_right = make_uniq<BoundComparisonExpression>(
318137 ExpressionType::COMPARE_LESSTHANOREQUALTO, func.children[0]->Copy(),
318138 make_uniq<BoundConstantExpression>(Value::BLOB_RAW(info.range_max)));
318139 auto filter_expr = make_uniq<BoundConjunctionExpression>(ExpressionType::CONJUNCTION_AND,
318140 std::move(filter_left), std::move(filter_right));
318141
318142 new_filter->expressions.push_back(std::move(filter_expr));
318143 }
318144 }
318145
318146 if (!new_filter->expressions.empty()) {
318147 new_filter->children = std::move(op->children);
318148 op->children.clear();
318149 op->children.push_back(std::move(new_filter));
318150 }
318151
318152 return op;
318153}
unique_ptr< LogicalOperator > Rewrite(unique_ptr< LogicalOperator > op)
Perform filter pushdown.
Definition duckdb.cpp:318112
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: