Module query::range_select::plan_rewrite

source ยท

Macrosยง

Structsยง

  • RangeExprRewriter will recursively search certain Expr, find all range_fn scalar udf contained in Expr, and collect the information required by the RangeSelect query, and finally modify the range_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 like range_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 all range_fn scalar udf contained in the project plan, collecting info we need to generate RangeSelect Query LogicalPlan and rewrite th original LogicalPlan.

Functionsยง