CuteChuanChuan opened a new pull request, #19592:
URL: https://github.com/apache/datafusion/pull/19592

   Implements the Spark-compatible `size` function that returns the number of 
elements in an array or the number of key-value pairs in a map.
   
   - Supports List, LargeList, FixedSizeList, and Map types
   - Returns NULL for NULL input (modern Spark 3.0+ behavior)
   - Returns Int32 to match Spark's IntegerType
   
   ## Which issue does this PR close?
   - Closes #5338.
   - Part of #15914.
   
   ## Rationale for this change
   The size function is a commonly used Spark SQL function that returns the 
number of elements in an array or the number of key-value pairs in a map.
   
   ## What changes are included in this PR?
   Implement Spark-compatible size function in the datafusion-spark crate:
   - Supports List, LargeList, FixedSizeList, and Map types
   - Returns Int32 to match Spark's IntegerType
   - Returns NULL for NULL input (modern Spark 3.0+ behavior)
   
   ## Are these changes tested?
   Yes:
   - Unit tests in size.rs for nullability, ListArray, MapArray, and 
FixedSizeListArray
   - SQL logic tests in spark/collection/size.slt
   
   ## Are there any user-facing changes?
   Yes, new size function available in the Spark crate.


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