jcamachor commented on a change in pull request #1185: [CALCITE-3012] 
areColumnsUnique for FULL OUTER JOIN could return wrong answer when ignoreNulls 
is false
URL: https://github.com/apache/calcite/pull/1185#discussion_r280569387
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
 ##########
 @@ -925,6 +925,21 @@ private boolean isUnique(Set<ImmutableBitSet> uniqueKeys, 
ImmutableBitSet key) {
     assertUniqueConsistent(rel);
   }
 
+  @Test public void testFullOuterJoinUniqueness1() {
+    final String sql = "select e.jb, d.nm \n"
+        + "from (select cast(null as int) jb from sales.emp "
+        + " where empno = 10 group by cast(null as int)) as e \n"
+        + "full outer join (select cast (null as int) nm from sales.dept "
+        + "group by cast(null as int)) as d on e.jb = d.nm \n"
+        + "group by e.jb, d.nm";
+    RelNode rel = convertSql(sql);
 
 Review comment:
   I see, makes sense. However, it seems comments are not consistent wrt 
behavior. Probably there is not a rule that makes a distinction between 'false' 
and 'null' right now, so it is fine. Maybe you can create a follow-up (you can 
leave it unassigned) so we can discuss and fix it. I will merge this patch 
shortly.

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