grorge123 commented on PR #6716:
URL: 
https://github.com/apache/datafusion-comet/pull/6716#issuecomment-6123637531

   Thanks for the ping. I reviewed this with AI assistance and found one case 
where it differs from Spark. With ANSI on and a table `t(ai array<int>, s 
string, k int)` holding `(NULL, 'bad', 1)`, `(array(1, 2), '2', 2)`, 
`(array(3), '7', 3)`:
   
   ```sql
   SELECT k FROM t DISTRIBUTE BY array_contains(ai, CAST(s AS INT)), 
array_position(ai, CAST(s AS INT))
   ```
   
   Spark raises `CAST_INVALID_INPUT`, as Comet does on main, but at d01ae0a8e 
Comet returns the rows. The shuffle serializes its partitioning keys outside 
`withSharedSubexpressions`, so `canShortCircuitNulls` sees no shared set and 
masks the shared cast. Either leaving the call unmasked when there is no shared 
set, as on main, or computing the shared set from the partitioning keys where 
the shuffle serializes them would fix it.
   


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