andygrove opened a new issue, #362:
URL: https://github.com/apache/datafusion-spark/issues/362

   ### Describe the bug
   
   `array_position` rejects a struct element whose field names differ from the 
array's only in case. Spark compares struct field names without case by default 
(`spark.sql.caseSensitive=false`) and finds the element.
   
   ### To Reproduce
   
   ```sql
   SELECT array_position(array(named_struct('a', 1)), named_struct('A', 1));
   ```
   
   datafusion-spark raises `[DATATYPE_MISMATCH.ARRAY_FUNCTION_DIFF_TYPES]`, 
because DataFusion cannot cast between structs whose field names differ only in 
case.
   
   Spark 4.2.0 returns `1`.
   
   ### Expected behavior
   
   `1`, as in Spark.
   
   ### Additional context
   
   The test in `array/array_position.slt` already notes the difference.
   


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