You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/02/25 01:51:00 UTC
[jira] [Commented] (CALCITE-2192) RelBuilder might wrongly skip
creation of Aggregate that prunes columns
[ https://issues.apache.org/jira/browse/CALCITE-2192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16375886#comment-16375886 ]
Julian Hyde commented on CALCITE-2192:
--------------------------------------
Reviewed, have made some minor changes, will commit when tests pass.
> RelBuilder might wrongly skip creation of Aggregate that prunes columns
> -----------------------------------------------------------------------
>
> Key: CALCITE-2192
> URL: https://issues.apache.org/jira/browse/CALCITE-2192
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
> Fix For: 1.16.0
>
>
> Issue can be reproduced with following test:
> {code:java}
> @Test public void testAggregate3() {
> final RelBuilder builder = RelBuilder.create(config().build());
> RelNode root =
> builder.scan("EMP")
> .aggregate(
> builder.groupKey(builder.field(1)),
> builder.aggregateCall(SqlStdOperatorTable.COUNT, false, false,
> null, "C"))
> .aggregate(
> builder.groupKey(builder.field(0)))
> .build();
> assertThat(str(root),
> is(""
> + "LogicalProject(ENAME=[$0])\n"
> + " LogicalAggregate(group=[{1}], C=[COUNT()])\n"
> + " LogicalTableScan(table=[[scott, EMP]])\n"));
> }
> {code}
> Without fix, builder will generate following plan, which contains an unnecessary field (in Hive, this results in an assertion error in RelFieldTrimmer):
> {code:java}
> LogicalAggregate(group=[{1}], C=[COUNT()])
> LogicalTableScan(table=[[scott, EMP]])
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)