You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Alessandro Solimando (Jira)" <ji...@apache.org> on 2024/05/20 16:47:00 UTC
[jira] [Resolved] (CALCITE-6340) RelBuilder drops traits when aggregating over duplicate projected fields
[ https://issues.apache.org/jira/browse/CALCITE-6340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alessandro Solimando resolved CALCITE-6340.
-------------------------------------------
Resolution: Fixed
Fixed via [{{327bfcc}}|https://github.com/apache/calcite/commit/327bfcc7799c4413a84a5ebe0849ff64853a7dd1], thanks [~jduong] for the contribution and [~adamkennedy77] for the review!
> RelBuilder drops traits when aggregating over duplicate projected fields
> ------------------------------------------------------------------------
>
> Key: CALCITE-6340
> URL: https://issues.apache.org/jira/browse/CALCITE-6340
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.36.0
> Reporter: Adam Kennedy
> Assignee: James Duong
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> In the RelBuilder method aggregate_, when (config.pruneInputOfAggregate() && r instanceof Project) line 2443 the Project will be rewritten to remove unused columns.
> When this happens, the new Project will be created with the following line
> {{{}2487: r =
> {}}}{{{}2488: project.copy(cluster.traitSet(), project.getInput(), newProjects,{}}}
> {{2489: builder.build());}}
>
> The use of cluster.traitSet() returns emptyTraitSet which is always going to use Convention.NONE regardless of the Rebuilder's ProjectFactory.
> In the case of a query plan using a non-Logical convention FOO, with FooProject nodes that require the FOO convention, RelBuilder will normally happily produce FooProject nodes with FOO convention, allowing many CoreRules to be easily reused for custom Conventions.
> However, while RelBuilder will produce FooProject with FOO convention in the majority of cases, for the one specific case of column pruning a Project input to an aggregate, it will instead product a FooProject with NONE convention.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)