jon-wei commented on a change in pull request #8566: Upgrade Calcite to 1.21
URL: https://github.com/apache/incubator-druid/pull/8566#discussion_r348863633
 
 

 ##########
 File path: sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
 ##########
 @@ -7589,7 +7595,12 @@ public void testProjectAfterSort2() throws Exception
     );
   }
 
+  /**
+   * In Calcite 1.17, this test worked, but after upgrading to Calcite 1.21, 
this query fails with:
 
 Review comment:
   I added a new test:
   
   ```
    @Test
     public void testProjectAfterSort3WithoutAmbiguity() throws Exception
     {
       // This query is equivalent to the one in testProjectAfterSort3 but 
renames the second grouping column
       // to avoid the ambiguous name exception. The inner sort is also 
optimized out in Calcite 1.21.
       testQuery(
           "select copydim1 from (select dim1, dim1 AS copydim1, count(*) cnt 
from druid.foo group by dim1, dim1 order by cnt)",
           ImmutableList.of(
               GroupByQuery.builder()
                           .setDataSource(CalciteTests.DATASOURCE1)
                           .setInterval(querySegmentSpec(Filtration.eternity()))
                           .setGranularity(Granularities.ALL)
                           .setDimensions(
                               dimensions(
                                   new DefaultDimensionSpec("dim1", "d0")
                               )
                           )
                           .setContext(QUERY_CONTEXT_DEFAULT)
                           .build()
           ),
           ImmutableList.of(
               new Object[]{""},
               new Object[]{"1"},
               new Object[]{"10.1"},
               new Object[]{"2"},
               new Object[]{"abc"},
               new Object[]{"def"}
           )
       );
     }
   ```
   
   As with the other project-after-sort tests, the inner ordering is optimized 
out.
   
   I'll need to do some more investigation to see if this is a bug or not.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to