I think we agree on this Vladimir, although I don't want to focus too much on the approach of Hive which I used mostly to have a concrete example but rather on the fact that normalization should be customizable.
If downstream projects can pass their own normalizer in the planner or possibly in RelBuilder then I guess we can cover pretty much every use case. WDYT? Best, Stamatis On Tue, Mar 9, 2021 at 8:16 AM Vladimir Sitnikov < sitnikov.vladi...@gmail.com> wrote: > Stamatis>a case where digest normalization is not desirable and > Stamatis>brings problems to a downstream project. > > It looks more like a custom normalizer to me rather than "normalization is > not desirable". > If I read the problem right, the very same idea was #1 in CALCITE-2450: > <<For AND, OR, IN: put "simpler" nodes first>>. > > The current "per rule" and "per rel" overhead is enormous, and it makes it > doubtful to use optimizer rules for shuffling predicate order. > It might be more efficient to have a consistent normalizer, so the rels > with different expression orders are not generated at all. > > Vladimir >