hsyuan opened a new pull request #2051: URL: https://github.com/apache/calcite/pull/2051
If the child subset is used to derive new traits for current relnode, the subset will be marked REQUIRED when registering the new derived relnode and later will add enforcers between other delivered subsets. e.g. a MergeJoin request both inputs hash distributed by [a,b] sorted by [a,b]. If the left input R1 happens to be distributed by [a], the MergeJoin can derive new traits from this input and request both input to be distributed by [a] sorted by [a,b]. In case there is a alternative R2 with ANY distribution in the left input's RelSet, we end up with requesting hash distribution [a] on alternative R2, which is unnecessary and waste, because we request distribution by [a] because of R1 can deliver the exact same distribution and we don't need to enforce properties on other subsets that can't satisfy the specific trait requirement. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org