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

Jesus Camacho Rodriguez closed CALCITE-948.
-------------------------------------------

Resolved in release 1.5.0 (2015-11-10)

> Indicator columns not preserved by RelFieldTrimmer
> --------------------------------------------------
>
>                 Key: CALCITE-948
>                 URL: https://issues.apache.org/jira/browse/CALCITE-948
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>             Fix For: 1.5.0
>
>
> CALCITE-828 introduced the usage of RelBuilder in RelFieldTrimmer. In Hive, 
> we are hitting an issue in RelFieldTrimmer with the following query:
> {noformat}
> SELECT a FROM T1 GROUP BY a GROUPING SETS (a);
> {noformat}
> The problem is that the {{indicator}} boolean in the Aggregate operator is 
> set to true, as grouping sets are present. In particular, the plan is the 
> following:
> {noformat}
> HiveAggregate(group=[{0}] indicator=[true])
>   HiveProject(a=[$0])
>     HiveTableScan(table=[[default.t1]])
> {noformat}
> However, RelFieldTrimmer will remove the indicator columns, as the number of 
> GroupingSets is <1. This creates a mismatch in the number of columns that 
> results in assertion error. By the definition of the trim function over an 
> Aggregate in RelFieldTrimmer, indicator columns should not be removed.
> PS. I tried to reproduce the issue in Calcite using the following query:
> {noformat}
> select ename, grouping(ename) from emp group by ename, grouping sets (ename)
> {noformat}
> But I could not, as Calcite infers directly the constant value for the 
> grouping column.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to