Wang Weidong created CALCITE-3466:
-------------------------------------

             Summary: JDBC adapter dropped group by statement in subquery
                 Key: CALCITE-3466
                 URL: https://issues.apache.org/jira/browse/CALCITE-3466
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.21.0, 1.22.0
            Reporter: Wang Weidong
             Fix For: 1.22.0


While convert RelNode to SqlNode, the "group by" statement in subquery was 
dropped unexpectedly. For example,
original sql is:
_select a, avg(c1) from (select a,sum(d),b as c1 from t_testProjectMerge group 
by b,a) as t group by a_
RelNode converted by SqlNode is 
_LogicalAggregate(group=[{0}], EXPR$1=[AVG($1)])
  LogicalProject(A=[$1], C1=[$0])
    LogicalAggregate(group=[{0, 1}], EXPR$1=[SUM($2)])
      LogicalProject(B=[$1], A=[$0], D=[$3])
        EnumerableTableScan(table=[[T_TESTPROJECTMERGE]])
_



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to