[
https://issues.apache.org/jira/browse/CALCITE-4097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Haisheng Yuan resolved CALCITE-4097.
------------------------------------
Fix Version/s: 1.24.0
Resolution: Fixed
Fixed inĀ
[https://github.com/apache/calcite/commit/640da7c6d85c3e83fe38fb45d7f23ef5e1000c4e].
> Avoid requesting unnecessary trait request when deriving traits from child
> inputs
> ---------------------------------------------------------------------------------
>
> Key: CALCITE-4097
> URL: https://issues.apache.org/jira/browse/CALCITE-4097
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
> Fix For: 1.24.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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 message was sent by Atlassian Jira
(v8.3.4#803005)