Oliver Lee created CALCITE-6683:
-----------------------------------

             Summary: AGG_M2V is exposed when calling toRel()
                 Key: CALCITE-6683
                 URL: https://issues.apache.org/jira/browse/CALCITE-6683
             Project: Calcite
          Issue Type: Bug
            Reporter: Oliver Lee


Following CALCITE-4496, I encountered this bug when calling toRel().

I have a SqlToRelConverterTest as follows:

 
{quote}final String sql = "with empm as (\n"
+ " select deptno, job, avg(sal) as measure avg_sal\n"
+ " from emp)\n"
+ "select job, aggregate(avg_sal)\n"
+ "from empm\n"
+ "group by job";

SqlToRelFixture f = fixture()
.withFactory(c ->
c.withOperatorTable(t ->
SqlValidatorTest.operatorTableFor(SqlLibrary.CALCITE)));

RelNode relNode = f.withSql(sql).toRel();{quote}
 
 
and the RelNode looks like this: 
 
{quote}rel#11:LogicalAggregate.(input=LogicalProject#10,group=\{0},EXPR$1=AGG_M2V($1))
{quote}

I dont the the AGG_M2V should be exposed.


It gets set to AGG_M2V in AggConverter.java: 
https://github.com/apache/calcite/blob/66919e4d44a2dc5019b595569bbd9fbfd5d163eb/core/src/main/java/org/apache/calcite/sql2rel/AggConverter.java#L504
 , but I haven't found a spot where this gets overwritten. 



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

Reply via email to