Description
In the ToLogicalConvert test, the LogicalPlan parsed with or without the distinct keyword is the same. I think this is an improvement.
@Test void testdistnct() { // Equivalent SQL: // SELECT DISTINCT * // FROM emp final RelBuilder builder = builder(); final RelNode rel = builder.scan("EMP") .distinct() .build(); String expectedPhysical = "" + "EnumerableTableScan(table=[[scott, EMP]])\n"; String expectedLogical = "" + "LogicalTableScan(table=[[scott, EMP]])\n"; verify(rel, expectedPhysical, expectedLogical); } @Test void test() { // Equivalent SQL: // SELECT DISTINCT * // FROM emp final RelBuilder builder = builder(); final RelNode rel = builder.scan("EMP") .build(); String expectedPhysical = "" + "EnumerableTableScan(table=[[scott, EMP]])\n"; String expectedLogical = "" + "LogicalTableScan(table=[[scott, EMP]])\n"; verify(rel, expectedPhysical, expectedLogical); }
I think it can be improved to something like
Logical Project (DISTINCT) +- Logical Scan (Table: employees)
Attachments
Issue Links
- relates to
-
CALCITE-1634 Make RelBuilder.distinct no-op if input is already distinct
- Closed