lyne7-sc opened a new issue, #23270:
URL: https://github.com/apache/datafusion/issues/23270

   ### Describe the bug
   
   `cardinality()` returns incorrect results for ragged nested arrays.
   
   For nested arrays, `cardinality()` should count the total number of leaf 
elements. However, the current implementation computes array dimensions using 
the first child array and then multiplies those dimensions. This works for 
rectangular nested arrays, but gives incorrect results for ragged nested arrays.
   
   ### To Reproduce
   
   ```sql
   SELECT cardinality([[1], [2, 3]]);
   ```
   
   Current result:
   2
   
   Expected result:
   3
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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