Hi, community: When I write a rule to match a subtree as a union followed by any number of RelNodes which is not an exchange node (I think this subtree can transpose before the union nodes), It will help reduce the shuffle in physical nodes. But there seems to be no suitable API to describe this greedy pattern match with an arbitrary number of intermediate nodes. If there is sth I missed, I would appreciate it if anyone could help point it out.
BTW, I read this ticket, it seems to have similar requirements: https://issues.apache.org/jira/browse/CALCITE-3761 Thanks Aitozi.
