calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Alexeev <michael.alex...@gmail.com>
Subject Pushing Down Collation Trait
Date Mon, 12 Mar 2018 00:26:02 GMT
Hi All,

Is there a way to push Sort RelNode collation trait down to its children?
Let say I have the following rel tree

LogicalSort
   LogicalProject
     LogicalFilter
       LogicalScan

and the goal is to push the collation trait all the way to the Scan node to
transform it to something like that

 PhysicalProject
   PhysicalFilter
     PhysicalScan with CollationTrait

or
PhysicalProject
   PhysicalFilter
     PhysicalSort
        PhysicalScan

 I have a rule that matches the sort node and transforms it to a result of
its input convert call where the collation trait together with the physical
convention trait is added to the child's trait set.
The rule seems to be firing but the collation trait is not propagated down
- the result of the Logical to Physical Scan conversion rule does not have
it.

If this approach is not possible what could be an alternative? Have various
transpose rules to position the sort rel just above the scan?

Thanks,
Mike

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message