[ 
https://issues.apache.org/jira/browse/CALCITE-6064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17777999#comment-17777999
 ] 

LakeShen commented on CALCITE-6064:
-----------------------------------

Hi [~rongr] ,could you give the example to explain this?Maybe it is a little 
hard to find a example.

In fact,because there are no ConverterRule used on logical RelNode,all the 
default convention of logical RelNode is Convention.NONE.

The default emptyTraitSet is always from the 'VolcanoPlanner#traitDefs',it 
could be getted to use 'VolcanoPlanner#getRelTraitDefs' method.The calcite user 
could registered  their 'RelTraitDef' by 'VolcanoPlanner#addRelTraitDef' 
method.The 'RelTraitDef' default value is returned by 'RelTraitDef#getDefault'.

IMO,I think that RelTraitSet is always used to build the distributed plan,so in 
logical phase,the RelTraitSet of logical RelNode is the default value.

So there should be no problem with 'LogicalJoin#copy',but the code is a little 
confusing.

> Incorrect TraitSet copying logic in LogicalJoin?
> ------------------------------------------------
>
>                 Key: CALCITE-6064
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6064
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: Rong Rong
>            Priority: Major
>
> See: https://github.com/walterddr/calcite/pull/3/files
> seems like the traitSet is not copied but the default emptyTraitSet is being 
> used with the Convention.NONE; while some other nodes (such as 
> https://github.com/walterddr/calcite/blob/23b7931c3e516bdb6cfedda956213f7fe06c6b24/core/src/main/java/org/apache/calcite/rel/logical/LogicalAggregate.java#L154)
>  are copying properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to