Module query::range_select::plan_rewrite
source ยท Macrosยง
- inconsistent_check ๐
Structsยง
RangeExprRewriter
will recursively search certainExpr
, find allrange_fn
scalar udf contained inExpr
, and collect the information required by the RangeSelect query, and finally modify therange_fn
scalar udf to an ordinary column field.- In order to implement RangeSelect query like
avg(field_0) RANGE '5m' FILL NULL
, All RangeSelect query items are converted into udf scalar function in sql parse stage, with format likerange_fn(avg(field_0), .....)
.range_fn
contains all the parameters we need to execute RangeSelect. In order to correctly execute the query process of range select, we need to modify the query plan generated by datafusion. We need to recursively find the entire LogicalPlan, and find allrange_fn
scalar udf contained in the project plan, collecting info we need to generate RangeSelect Query LogicalPlan and rewrite th original LogicalPlan.
Functionsยง
- dispose_parse_error ๐
- Evaluate a time calculation expr, case like:
- have_range_in_exprs ๐
- parse_align_to ๐Parse the
align to
clause and return a UTC timestamp with unit of millisecond, which is used as the basis for dividing time slot during the align operation. - parse_duration_expr ๐Parse a duraion expr:
- parse_expr_list ๐
- parse_expr_to_string ๐
- parse_str_expr ๐