Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
If you have a test like the following (modified from SqlToRelConverterTest#testMeasureRef)
final String sql = "select deptno as c\n" + "from empm\n" + "group by deptno"; fixture() .withFactory(c -> c.withOperatorTable(t -> SqlValidatorTest.operatorTableFor(SqlLibrary.CALCITE))) .withCatalogReader(MockCatalogReaderExtended::create) .withSql(sql) .ok();
The expected results should look something like:
LogicalAggregate(group=[{0}]) LogicalProject(C=[$7]) LogicalTableScan(table=[[CATALOG, SALES, EMPM]])
Instead it looks like:
LogicalAggregate(group=[{0}]) LogicalProject(C=[$7], COUNT_PLUS_100=[$9], COUNT_TIMES_100=[$10]) LogicalTableScan(table=[[CATALOG, SALES, EMPM]])
I believe this is due to commit 568ce12.
In essence, the measures should not be added to the projects unless necessary.
Attachments
Issue Links
- is related to
-
CALCITE-4496 Measure columns ("SELECT ... AS MEASURE")
- Closed
- links to