Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cubesql): Move all wrapper replacers params to separate enode (
#9105) Move all replacer parameters from `WrapperPushdownReplacer` and `WrapperPullupReplacer` to separate node variant `WrapperReplacerContext`. Because of the way our current `plan_to_language!` works, for every non-recusive param in input enum it generates separate wrapper struct on Rust side. So, before this we had separate `WrapperPushdownReplacerPushToCube` and `WrapperPullupReplacerPushToCube`. And, because they are separate terminal variants, one can't just copy those in patterns, and had to do it in Rust code, like in `transforming_rewrite`. This change allows: * Copy context parts between push-down and pull-up replacers directly in patterns * Completely ignore context in patterns, like `wrapper_pushdown_replacer(cast_expr("?expr", "?data_type"), "?context")` => `cast_expr(wrapper_pushdown_replacer("?expr", "?context"), "?data_type")` * Share same eclass with context for a whole replacer stage, instead of one for push-down and one for pull-up All of this simplifies adding new parameters, and have measurable performance boost. On my laptop I measured from about 1 to 11% boost, depending on a benchmark. For example: ``` power_bi_wrap time: [38.386 ms 38.482 ms 38.624 ms] change: [-4.7016% -4.3391% -3.9957%] (p = 0.00 < 0.05) Performance has improved. ... large_model_1000_select_all_dimensions_with_filter time: [190.47 ms 190.88 ms 191.17 ms] change: [-12.353% -11.824% -11.374%] (p = 0.00 < 0.05) Performance has improved. ```
- Loading branch information