[ 
https://issues.apache.org/jira/browse/CALCITE-4513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stamatis Zampetakis resolved CALCITE-4513.
------------------------------------------
    Fix Version/s: 1.38.0
       Resolution: Fixed

Thanks for checking [~thomas.rebele] ! If this is fixed then we can mark this 
ticket as resolved.

> RelBuilder.aggregate destroys input traits when pruning unused fields of 
> project
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-4513
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4513
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.23.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>             Fix For: 1.38.0
>
>
> RelBuilder attempts to prune unused fields when the underlying input is a 
> project and the respective configuration 
> ({{RelBuilder.Config#pruneInputOfAggregate}}) is enabled (CALCITE-3763). As a 
> result of this optimization a new project operator is introduced in the plan.
> The new operator is created via {{Project#copy}} method but instead of 
> retaining or adapting the previous traitset a new one is created 
> (https://github.com/apache/calcite/blob/94502f51e6a12cd53cec88b39d21b4fec6070428/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L1922).
> {code:java}
>         r = project.copy(cluster.traitSet(), project.getInput(), newProjects,
>             builder.build());
> {code}
> The main problem with that is that a {{HiveProject}} operator which used to 
> be in {{HiveConvention}} will be transformed to a {{HiveProject}} operator in 
> {{Convention.None}}. Obviously other traits (apart from {{Convention}}) 
> potentially present in the operator are also lost after the transformation.



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

Reply via email to