You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/06/16 04:13:44 UTC

[GitHub] [calcite] amaliujia commented on a change in pull request #2020: [CALCITE-4060] Supports implicit type coercion for NOT IN.

amaliujia commented on a change in pull request #2020:
URL: https://github.com/apache/calcite/pull/2020#discussion_r440575715



##########
File path: core/src/test/java/org/apache/calcite/test/TypeCoercionConverterTest.java
##########
@@ -61,6 +61,14 @@
         + "from (values (true, true, true))");
   }
 
+  @Test void testNotInOperation() {
+    checkPlanEquals("select\n"
+        + "4 not in ('1', '2', '3') as f0,\n"
+        + "(3, 4) not in (('1', '2')) as f1,\n"
+        + "(2, 3) not in (('1', '2'), ('3', '4')) as f2\n"
+        + "from (values (true, true, true))");

Review comment:
       Trying to understand this test case: 
   
   so it tests if value is coerced and the way to check it is doing not_in. For example.  `4 not in ('1', '2', '3')`. 4 should be coerced to varchar then it is not in `('1', '2', '3')`.
   
   Then, I guess what is missing is negative cases. Because seems to me that even 4 is coerced, it will still not in  ('1', '2', '3'). 
   
   So for each positive case here, there could be a negative case. For example, `3 not in ('1', '2', '3')` which returns false.




----------------------------------------------------------------
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:
users@infra.apache.org