hsyuan commented on a change in pull request #1493: [CALCITE-3396] 
Materialization matching succeeds when query and view …
URL: https://github.com/apache/calcite/pull/1493#discussion_r333728051
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/MaterializationTest.java
 ##########
 @@ -2468,12 +2468,25 @@ private void checkSatisfiable(RexNode e, String s) {
     checkMaterialize(sql, sql);
   }
 
-  @Test public void testUnionToUnion() {
+  @Test public void testUnionToUnion0() {
     String sql0 = "select * from \"emps\" where \"empid\" < 300";
     String sql1 = "select * from \"emps\" where \"empid\" > 200";
     checkMaterialize(sql0 + " union all " + sql1, sql1 + " union all " + sql0);
   }
 
+  @Test public void testUnionToUnion1() {
+    String sql0 = "select * from \"emps\" where \"empid\" < 300";
+    String sql1 = "select * from \"emps\" where \"empid\" > 200";
+    checkMaterialize(sql0 + " union " + sql1, sql1 + " union " + sql0);
+  }
+
+  @Test public void testUnionToUnion2() {
+    String sql0 = "select * from \"emps\" where \"empid\" < 300";
+    String sql1 = "select * from \"emps\" where \"empid\" > 200";
+    checkNoMaterialize(sql0 + " union " + sql1, sql0 + " union all " + sql1,
+        HR_FKUK_MODEL);
+  }
+
 
 Review comment:
   If the MV is `union all`, but query is `union`, we can still materialize, 
right?

----------------------------------------------------------------
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

Reply via email to