mihaibudiu commented on code in PR #4368:
URL: https://github.com/apache/calcite/pull/4368#discussion_r2083212651


##########
core/src/test/resources/sql/join.iq:
##########
@@ -854,4 +854,154 @@ EnumerableCalc(expr#0..1=[{inputs}], A=[$t0])
     EnumerableValues(tuples=[[{ 1 }, { null }]])
 !plan
 
+# Test for Double
+SELECT t1.a

Review Comment:
   the test is good, but add a DOUBLE test too
   In general, joining on double is tricky, but for this case it should work 
fine
   



##########
core/src/test/resources/sql/join.iq:
##########
@@ -854,4 +854,154 @@ EnumerableCalc(expr#0..1=[{inputs}], A=[$t0])
     EnumerableValues(tuples=[[{ 1 }, { null }]])
 !plan
 
+# Test for Double
+SELECT t1.a
+FROM (VALUES (1.0), (2.0), (null)) AS t1(a)
+JOIN (VALUES (1.0), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++-----+
+| A   |
++-----+
+| 1.0 |
+|     |
++-----+
+(2 rows)
+
+!ok
+
+# Test for Int
+SELECT t1.a
+FROM (VALUES (1), (2), (null)) AS t1(a)
+JOIN (VALUES (1), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++---+
+| A |
++---+
+| 1 |
+|   |
++---+
+(2 rows)
+
+!ok
+
+# Test for Varchar/Char
+SELECT t1.a
+FROM (VALUES ('x'), ('y'), (null)) AS t1(a)
+JOIN (VALUES ('x'), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++---+
+| A |
++---+
+| x |
+|   |
++---+
+(2 rows)
+
+!ok
+
+# Test for Boolean
+SELECT t1.a
+FROM (VALUES (true), (false), (null)) AS t1(a)
+JOIN (VALUES (true), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++------+
+| A    |
++------+
+| true |
+|      |
++------+
+(2 rows)
+
+!ok
+
+# Test for Date
+SELECT t1.a
+FROM (VALUES (DATE '2025-05-10'), (DATE '2025-05-11'), (null)) AS t1(a)
+JOIN (VALUES (DATE '2025-05-10'), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++------------+
+| A          |
++------------+
+| 2025-05-10 |
+|            |
++------------+
+(2 rows)
+
+!ok
+
+# Test for TimesStamp

Review Comment:
   typo



##########
core/src/test/resources/sql/join.iq:
##########
@@ -854,4 +854,154 @@ EnumerableCalc(expr#0..1=[{inputs}], A=[$t0])
     EnumerableValues(tuples=[[{ 1 }, { null }]])
 !plan
 
+# Test for Double
+SELECT t1.a

Review Comment:
   I think these are DECIMAL.
   For DOUBLE you have to write 1.0e0



##########
core/src/test/resources/sql/join.iq:
##########
@@ -854,4 +854,154 @@ EnumerableCalc(expr#0..1=[{inputs}], A=[$t0])
     EnumerableValues(tuples=[[{ 1 }, { null }]])
 !plan
 
+# Test for Double
+SELECT t1.a
+FROM (VALUES (1.0), (2.0), (null)) AS t1(a)
+JOIN (VALUES (1.0), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++-----+
+| A   |
++-----+
+| 1.0 |
+|     |
++-----+
+(2 rows)
+
+!ok
+
+# Test for Int
+SELECT t1.a
+FROM (VALUES (1), (2), (null)) AS t1(a)
+JOIN (VALUES (1), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++---+
+| A |
++---+
+| 1 |
+|   |
++---+
+(2 rows)
+
+!ok
+
+# Test for Varchar/Char
+SELECT t1.a
+FROM (VALUES ('x'), ('y'), (null)) AS t1(a)
+JOIN (VALUES ('x'), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++---+
+| A |
++---+
+| x |
+|   |
++---+
+(2 rows)
+
+!ok
+
+# Test for Boolean
+SELECT t1.a
+FROM (VALUES (true), (false), (null)) AS t1(a)
+JOIN (VALUES (true), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++------+
+| A    |
++------+
+| true |
+|      |
++------+
+(2 rows)
+
+!ok
+
+# Test for Date
+SELECT t1.a
+FROM (VALUES (DATE '2025-05-10'), (DATE '2025-05-11'), (null)) AS t1(a)
+JOIN (VALUES (DATE '2025-05-10'), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++------------+
+| A          |
++------------+
+| 2025-05-10 |
+|            |
++------------+
+(2 rows)
+
+!ok
+
+# Test for TimesStamp
+SELECT t1.a
+FROM (VALUES (TIMESTAMP '2025-05-10 10:22:34'), (TIMESTAMP '2025-05-11 
10:22:34'), (null)) AS t1(a)
+JOIN (VALUES (TIMESTAMP '2025-05-10 10:22:34'), (null)) AS t2(a)
+ON t1.a IS NOT DISTINCT FROM t2.a;
++---------------------+
+| A                   |
++---------------------+
+| 2025-05-10 10:22:34 |
+|                     |
++---------------------+
+(2 rows)
+
+!ok
+
+# Test for Decimal

Review Comment:
   were these tests failing previously?
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to