calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [3/4] calcite git commit: [CALCITE-1634] Make RelBuilder.distinct no-op if input is already distinct; use it in RelDecorrelator
Date Wed, 15 Feb 2017 05:32:47 GMT
[CALCITE-1634] Make RelBuilder.distinct no-op if input is already distinct; use it in RelDecorrelator

Deprecate RelOptUtil.createDistinctRel.


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/dc03b5ae
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/dc03b5ae
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/dc03b5ae

Branch: refs/heads/master
Commit: dc03b5ae98d06bfdb167a97b62310dc1b5456aba
Parents: 3b78d1d
Author: Julian Hyde <jhyde@apache.org>
Authored: Fri Jan 20 11:48:28 2017 -0800
Committer: Julian Hyde <jhyde@apache.org>
Committed: Tue Feb 14 14:17:45 2017 -0800

----------------------------------------------------------------------
 .../org/apache/calcite/plan/RelOptUtil.java     |   9 +-
 .../apache/calcite/runtime/PredicateImpl.java   |   2 +-
 .../sql/validate/IdentifierNamespace.java       |   2 +-
 .../apache/calcite/sql2rel/RelDecorrelator.java |   4 +-
 .../org/apache/calcite/tools/RelBuilder.java    |  23 ++++
 .../apache/calcite/test/PigRelBuilderTest.java  |   6 +-
 .../org/apache/calcite/test/RelBuilderTest.java |  45 ++++++-
 .../org/apache/calcite/test/RelOptRulesTest.xml | 127 ++++++++-----------
 8 files changed, 129 insertions(+), 89 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
index c0073ea..b5d3cb3 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
@@ -767,13 +767,8 @@ public abstract class RelOptUtil {
         ImmutableBitSet.of(), null, aggCalls);
   }
 
-  /**
-   * Creates a LogicalAggregate that removes all duplicates from the result of
-   * an underlying relational expression.
-   *
-   * @param rel underlying rel
-   * @return rel implementing DISTINCT
-   */
+  /** @deprecated Use {@link RelBuilder#distinct()}. */
+  @Deprecated // to be removed before 2.0
   public static RelNode createDistinctRel(RelNode rel) {
     return LogicalAggregate.create(rel, false,
         ImmutableBitSet.range(rel.getRowType().getFieldCount()), null,

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java b/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java
index c958b74..f04737b 100644
--- a/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java
+++ b/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java
@@ -26,7 +26,7 @@ import javax.annotation.Nullable;
  * <p>Derived class needs to implement the {@link #test} method.
  *
  * <p>Helps with the transition to {@code java.util.function.Predicate},
- * which was introduced in JDK 1.8, and is required in Guava 21.0 and higer,
+ * which was introduced in JDK 1.8, and is required in Guava 21.0 and higher,
  * but still works on JDK 1.7.
  *
  * @param <T> the type of the input to the predicate

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java
index f198389..f5ffde3 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java
@@ -128,7 +128,7 @@ public class IdentifierNamespace extends AbstractNamespace {
     // lenient match. If we find something we can offer a helpful hint.
     if (nameMatcher.isCaseSensitive()) {
       final SqlNameMatcher liberalMatcher = SqlNameMatchers.liberal();
-      resolved.clear(); // TODO: remove?
+      resolved.clear();
       parentScope.resolveTable(names, liberalMatcher,
           SqlValidatorScope.Path.EMPTY, resolved);
       if (resolved.count() == 1) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
index 9ef7b21..0e6bd6a 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java
@@ -749,7 +749,9 @@ public class RelDecorrelator implements ReflectiveVisitor {
             RelOptUtil.createProject(
                 newInput,
                 mapNewInputToOutputPos.get(newInput));
-        RelNode distinct = RelOptUtil.createDistinctRel(project);
+        RelNode distinct = relBuilder.push(project)
+            .distinct()
+            .build();
         RelOptCluster cluster = distinct.getCluster();
 
         joinedInputRelSet.add(newInput);

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/tools/RelBuilder.java b/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
index 153889b..9a19a24 100644
--- a/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
+++ b/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
@@ -36,6 +36,7 @@ import org.apache.calcite.rel.core.RelFactories;
 import org.apache.calcite.rel.core.Sort;
 import org.apache.calcite.rel.core.TableScan;
 import org.apache.calcite.rel.core.Values;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
@@ -979,6 +980,28 @@ public class RelBuilder {
     final GroupKeyImpl groupKey_ = (GroupKeyImpl) groupKey;
     final ImmutableBitSet groupSet =
         ImmutableBitSet.of(registerExpressions(extraNodes, groupKey_.nodes));
+  label:
+    if (Iterables.isEmpty(aggCalls)) {
+      final RelMetadataQuery mq = RelMetadataQuery.instance();
+      if (groupSet.isEmpty()) {
+        final Double minRowCount = mq.getMinRowCount(peek());
+        if (minRowCount == null || minRowCount < 1D) {
+          // We can't remove "GROUP BY ()" if there's a chance the rel could be
+          // empty.
+          break label;
+        }
+      }
+      final Boolean unique = mq.areColumnsUnique(peek(), groupSet);
+      if (unique != null && unique) {
+        // Rel is already unique. Nothing to do.
+        return this;
+      }
+      final Double maxRowCount = mq.getMaxRowCount(peek());
+      if (maxRowCount != null && maxRowCount <= 1D) {
+        // If there is at most one row, rel is already unique.
+        return this;
+      }
+    }
     final ImmutableList<ImmutableBitSet> groupSets;
     if (groupKey_.nodeLists != null) {
       final int sizeBefore = extraNodes.size();

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
index cc982cb..bafd4a5 100644
--- a/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
+++ b/core/src/test/java/org/apache/calcite/test/PigRelBuilderTest.java
@@ -63,10 +63,12 @@ public class PigRelBuilderTest {
     final PigRelBuilder builder = PigRelBuilder.create(config().build());
     final RelNode root = builder
         .scan("EMP")
+        .project(builder.field("DEPTNO"))
         .distinct()
         .build();
-    final String plan = "LogicalAggregate(group=[{0, 1, 2, 3, 4, 5, 6, 7}])\n"
-        + "  LogicalTableScan(table=[[scott, EMP]])\n";
+    final String plan = "LogicalAggregate(group=[{0}])\n"
+        + "  LogicalProject(DEPTNO=[$7])\n"
+        + "    LogicalTableScan(table=[[scott, EMP]])\n";
     assertThat(str(root), is(plan));
   }
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
index 61d5235..3682973 100644
--- a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
@@ -678,16 +678,53 @@ public class RelBuilderTest {
 
   @Test public void testDistinct() {
     // Equivalent SQL:
-    //   SELECT DISTINCT *
-    //   FROM dept
+    //   SELECT DISTINCT deptno
+    //   FROM emp
+    final RelBuilder builder = RelBuilder.create(config().build());
+    RelNode root =
+        builder.scan("EMP")
+            .project(builder.field("DEPTNO"))
+            .distinct()
+            .build();
+    final String expected = "LogicalAggregate(group=[{0}])\n"
+        + "  LogicalProject(DEPTNO=[$7])\n"
+        + "    LogicalTableScan(table=[[scott, EMP]])\n";
+    assertThat(str(root),
+        is(expected));
+  }
+
+  @Test public void testDistinctAlready() {
+    // DEPT is already distinct
     final RelBuilder builder = RelBuilder.create(config().build());
     RelNode root =
         builder.scan("DEPT")
             .distinct()
             .build();
     assertThat(str(root),
-        is("LogicalAggregate(group=[{0, 1, 2}])\n"
-                + "  LogicalTableScan(table=[[scott, DEPT]])\n"));
+        is("LogicalTableScan(table=[[scott, DEPT]])\n"));
+  }
+
+  @Test public void testDistinctEmpty() {
+    // Is a relation with zero columns distinct?
+    // What about if we know there are zero rows?
+    // It is a matter of definition: there are no duplicate rows,
+    // but applying "select ... group by ()" to it would change the result.
+    // In theory, we could omit the distinct if we know there is precisely one
+    // row, but we don't currently.
+    final RelBuilder builder = RelBuilder.create(config().build());
+    RelNode root =
+        builder.scan("EMP")
+            .filter(
+                builder.call(SqlStdOperatorTable.IS_NULL,
+                    builder.field("COMM")))
+            .project()
+            .distinct()
+            .build();
+    final String expected = "LogicalAggregate(group=[{}])\n"
+        + "  LogicalProject\n"
+        + "    LogicalFilter(condition=[IS NULL($6)])\n"
+        + "      LogicalTableScan(table=[[scott, EMP]])\n";
+    assertThat(str(root), is(expected));
   }
 
   @Test public void testUnion() {

http://git-wip-us.apache.org/repos/asf/calcite/blob/dc03b5ae/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml b/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
index 66c634b..b2c5ac1 100644
--- a/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
+++ b/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
@@ -343,14 +343,12 @@ LogicalProject(SAL=[$5])
         LogicalFilter(condition=[=($0, $9)])
           LogicalCorrelate(correlation=[$cor0], joinType=[INNER], requiredColumns=[{2}])
             LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-            LogicalAggregate(group=[{0}])
-              LogicalProject(DEPTNO=[$0])
-                LogicalFilter(condition=[=($cor0.JOB, $1)])
-                  LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
-        LogicalAggregate(group=[{0}])
-          LogicalProject(EMPNO=[$0])
-            LogicalFilter(condition=[=($cor0.ENAME, $1)])
-              LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+            LogicalProject(DEPTNO=[$0])
+              LogicalFilter(condition=[=($cor0.JOB, $1)])
+                LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+        LogicalProject(EMPNO=[$0])
+          LogicalFilter(condition=[=($cor0.ENAME, $1)])
+            LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>
         </Resource>
         <Resource name="planAfter">
@@ -360,22 +358,18 @@ LogicalProject(SAL=[$5])
     LogicalJoin(condition=[AND(=($1, $12), =($0, $11))], joinType=[inner])
       LogicalJoin(condition=[AND(=($2, $10), =($0, $9))], joinType=[inner])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-        LogicalAggregate(group=[{0, 1}])
-          LogicalProject(DEPTNO=[$0], JOB=[$1])
-            LogicalProject(DEPTNO=[$0], JOB=[$2])
-              LogicalJoin(condition=[=($2, $1)], joinType=[inner])
-                LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
-                LogicalAggregate(group=[{0}])
-                  LogicalProject(JOB=[$2])
-                    LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-      LogicalAggregate(group=[{0, 1}])
-        LogicalProject(EMPNO=[$0], ENAME0=[$1])
-          LogicalProject(EMPNO=[$0], ENAME0=[$9])
-            LogicalJoin(condition=[=($9, $1)], joinType=[inner])
+        LogicalProject(DEPTNO=[$0], JOB=[$2])
+          LogicalJoin(condition=[=($2, $1)], joinType=[inner])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+            LogicalAggregate(group=[{0}])
+              LogicalProject(JOB=[$2])
+                LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+      LogicalProject(EMPNO=[$0], ENAME0=[$9])
+        LogicalJoin(condition=[=($9, $1)], joinType=[inner])
+          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+          LogicalAggregate(group=[{0}])
+            LogicalProject(ENAME=[$1])
               LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-              LogicalAggregate(group=[{0}])
-                LogicalProject(ENAME=[$1])
-                  LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>
         </Resource>
     </TestCase>
@@ -4131,9 +4125,8 @@ LogicalProject(DEPTNO=[$0], NAME=[$1])
           LogicalProject(SAL=[$5], DEPTNO=[$7])
             LogicalFilter(condition=[>($5, 100)])
               LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-          LogicalAggregate(group=[{0}])
-            LogicalProject(DEPTNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+          LogicalProject(DEPTNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 ]]>
         </Resource>
         <Resource name="planAfter">
@@ -4145,9 +4138,8 @@ SemiJoin(condition=[=($0, $2)], joinType=[inner])
       LogicalProject(SAL=[$5], DEPTNO=[$7])
         LogicalFilter(condition=[>($5, 100)])
           LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-      LogicalAggregate(group=[{0}])
-        LogicalProject(DEPTNO=[$0])
-          LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+      LogicalProject(DEPTNO=[$0])
+        LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 ]]>
         </Resource>
     </TestCase>
@@ -4168,9 +4160,8 @@ LogicalProject(DEPTNO=[$0])
         LogicalJoin(condition=[=($7, $9)], joinType=[inner])
           LogicalFilter(condition=[>($5, 100)])
             LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-          LogicalAggregate(group=[{0}])
-            LogicalProject(DEPTNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+          LogicalProject(DEPTNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
     LogicalTableScan(table=[[CATALOG, CUSTOMER, ACCOUNT]])
 ]]>
         </Resource>
@@ -4186,9 +4177,8 @@ LogicalProject(DEPTNO=[$0])
           LogicalFilter(condition=[>($0, 100)])
             LogicalProject(SAL=[$5], DEPTNO=[$7])
               LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-          LogicalAggregate(group=[{0}])
-            LogicalProject(DEPTNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+          LogicalProject(DEPTNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
     LogicalProject(ACCTNO=[$0])
       LogicalTableScan(table=[[CATALOG, CUSTOMER, ACCOUNT]])
 ]]>
@@ -5920,11 +5910,10 @@ LogicalProject(EMPNO=[$0])
     LogicalFilter(condition=[OR(IS NOT NULL($11), <($5, 100))])
       LogicalJoin(condition=[AND(=($0, $9), =($7, $10))], joinType=[left])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-        LogicalAggregate(group=[{0, 1, 2}])
-          LogicalProject(EMPNO=[$0], DEPTNO=[$1], i=[true])
-            LogicalProject(EMPNO=[$0], DEPTNO=[$7])
-              LogicalFilter(condition=[<($0, 20)])
-                LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+        LogicalProject(EMPNO=[$0], DEPTNO=[$1], i=[true])
+          LogicalProject(EMPNO=[$0], DEPTNO=[$7])
+            LogicalFilter(condition=[<($0, 20)])
+              LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>
         </Resource>
     </TestCase>
@@ -6149,11 +6138,10 @@ LogicalProject(EMPNO=[$0], DEPTNO=[$7])
 LogicalProject(EMPNO=[$0], D=[CASE(IS NOT NULL($11), true, false)])
   LogicalJoin(condition=[AND(=($0, $9), =($7, $10))], joinType=[left])
     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-    LogicalAggregate(group=[{0, 1, 2}])
-      LogicalProject(EMPNO=[$0], DEPTNO=[$1], i=[true])
-        LogicalProject(EMPNO=[$0], DEPTNO=[$7])
-          LogicalFilter(condition=[<($0, 20)])
-            LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+    LogicalProject(EMPNO=[$0], DEPTNO=[$1], i=[true])
+      LogicalProject(EMPNO=[$0], DEPTNO=[$7])
+        LogicalFilter(condition=[<($0, 20)])
+          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>
         </Resource>
     </TestCase>
@@ -6745,8 +6733,8 @@ LogicalProject(DEPTNO=[$0])
             <![CDATA[
 LogicalProject(SAL=[$5])
   LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6],
DEPTNO=[$7], SLACKER=[$8])
-    LogicalFilter(condition=[NOT(CASE(=($10, 0), false, IS NOT NULL($14), true, <($11,
$10), true, false))])
-      LogicalJoin(condition=[AND(=($0, $15), =($2, $13))], joinType=[left])
+    LogicalFilter(condition=[NOT(CASE(=($10, 0), false, IS NOT NULL($13), true, <($11,
$10), true, false))])
+      LogicalJoin(condition=[AND(=($0, $15), =($2, $14))], joinType=[left])
         LogicalJoin(condition=[=($2, $9)], joinType=[left])
           LogicalTableScan(table=[[CATALOG, SALES, EMP]])
           LogicalAggregate(group=[{0}], c=[COUNT()], ck=[COUNT($1)])
@@ -6758,19 +6746,15 @@ LogicalProject(SAL=[$5])
                     LogicalProject(JOB=[$2])
                       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
         LogicalJoin(condition=[=($3, $0)], joinType=[inner])
-          LogicalProject(DEPTNO=[$0], JOB=[$1], $f2=[true])
-            LogicalAggregate(group=[{0, 1}])
-              LogicalProject(DEPTNO=[$0], JOB=[$2], i=[$1])
-                LogicalProject(DEPTNO=[$0], i=[true], JOB=[$1])
-                  LogicalProject(DEPTNO=[$0], JOB=[$2])
-                    LogicalJoin(condition=[=($2, $1)], joinType=[inner])
-                      LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
-                      LogicalAggregate(group=[{0}])
-                        LogicalProject(JOB=[$2])
-                          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-          LogicalAggregate(group=[{0}])
-            LogicalProject(EMPNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+          LogicalProject(DEPTNO=[$0], i=[true], JOB=[$1])
+            LogicalProject(DEPTNO=[$0], JOB=[$2])
+              LogicalJoin(condition=[=($2, $1)], joinType=[inner])
+                LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+                LogicalAggregate(group=[{0}])
+                  LogicalProject(JOB=[$2])
+                    LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+          LogicalProject(EMPNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>
         </Resource>
         <Resource name="planMid">
@@ -6786,11 +6770,10 @@ LogicalProject(SAL=[$5])
               LogicalFilter(condition=[=($cor0.JOB, $1)])
                 LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
         LogicalFilter(condition=[=($cor0.EMPNO, $0)])
-          LogicalAggregate(group=[{0, 1}])
-            LogicalProject(DEPTNO=[$0], i=[true])
-              LogicalProject(DEPTNO=[$0])
-                LogicalFilter(condition=[=($cor0.JOB, $1)])
-                  LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+          LogicalProject(DEPTNO=[$0], i=[true])
+            LogicalProject(DEPTNO=[$0])
+              LogicalFilter(condition=[=($cor0.JOB, $1)])
+                LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 ]]>
         </Resource>
     </TestCase>
@@ -6817,10 +6800,9 @@ LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4],
SAL=[$
     LogicalFilter(condition=[OR(=($5, 4), NOT(CASE(IS NOT NULL($10), true, false)))])
       LogicalJoin(condition=[=($0, $9)], joinType=[left])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-        LogicalAggregate(group=[{0, 1}])
-          LogicalProject(DEPTNO=[$0], i=[true])
-            LogicalProject(DEPTNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+        LogicalProject(DEPTNO=[$0], i=[true])
+          LogicalProject(DEPTNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 ]]>
         </Resource>
         <Resource name="planAfter">
@@ -6830,10 +6812,9 @@ LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4],
SAL=[$
     LogicalFilter(condition=[OR(=($5, 4), NOT(CASE(IS NOT NULL($10), true, false)))])
       LogicalJoin(condition=[=($0, $9)], joinType=[left])
         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
-        LogicalAggregate(group=[{0, 1}])
-          LogicalProject(DEPTNO=[$0], i=[true])
-            LogicalProject(DEPTNO=[$0])
-              LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+        LogicalProject(DEPTNO=[$0], i=[true])
+          LogicalProject(DEPTNO=[$0])
+            LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 ]]>
         </Resource>
     </TestCase>


Mime
View raw message