1fanwang commented on code in PR #7741:
URL: https://github.com/apache/datafusion-comet/pull/7741#discussion_r4700715002


##########
spark/src/test/resources/sql-tests/expressions/conditional/logical_lazy_ansi.sql:
##########
@@ -72,3 +72,21 @@ SELECT v = 1 OR 100 / v > 1 FROM test_lazy_logical WHERE v 
IS NOT NULL
 
 query expect_error(CAST_INVALID_INPUT)
 SELECT v, v IN (1, CAST(s AS INT)) FROM test_lazy_logical WHERE v IS NOT NULL
+
+-- IN is NULL for a NULL value without evaluating any candidate, and a value 
that can fail, such
+-- as an ANSI addition, is still evaluated lazily
+statement
+CREATE TABLE test_lazy_in(v int, s string) USING parquet
+
+statement
+INSERT INTO test_lazy_in SELECT /*+ REPARTITION(1) */ * FROM VALUES
+  (0, 'bad'), (NULL, 'bad'), (2, '2') AS t(v, s)

Review Comment:
   Confirmed and applied in cc5dfaf2b16cf18b1c0156f3fc8433faf7cdd6c4:
   
   
https://github.com/apache/datafusion-comet/blob/cc5dfaf2b16cf18b1c0156f3fc8433faf7cdd6c4/spark/src/test/resources/sql-tests/expressions/conditional/logical_lazy_ansi.sql#L28-L87
   
   I also added one query of my own, covered below along with how I verified 
all of this.
   
   <details>
   <summary>Verification and one addition</summary>
   
   I checked every pre-existing query against the new row by hand: each already 
filters v IS NOT NULL, filters s != 'bad', or never reads s. I then traced the 
three migrated queries row by row against Spark's In.eval null rule; none error.
   
   I added one query beyond the consolidation, reading the same table: v IN 
(CAST(s AS INT), 1), filtered the way your other comment suggested. It pins the 
fallible-first-candidate fix, which none of the existing queries exercised on 
their own.
   
   I could not execute this file's JVM suite in this environment (see the reply 
on the test-file thread for the JDK issue), so this is hand-verified against 
Spark's documented semantics rather than run.
   </details>



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to