jayzhan211 opened a new issue, #7136: URL: https://github.com/apache/arrow-datafusion/issues/7136
### Is your feature request related to a problem or challenge? Follow up on #6900. Implement array() nested version. It seems calling array() for list return flattened list according to the comment https://github.com/apache/arrow-datafusion/blob/2cf5f5b5bb824598de185d64c541c52c930728cf/datafusion/physical-expr/src/array_expressions.rs#L243-L254 However, I think make_array should wrap the elements into array, the expected behavior `make_array([A,X], []) -> [[A,X], []]`, `make_array([null, Y], [Q,R,S]) -> [[null,Y],[Q,R,S]]` and `make_array([C,Z], null) -> [[C,Z], null]` Main branch: ``` query ? select make_array(['A','X'], []); ---- [[A, X], ] query ? select make_array(make_array(null,'Y'), make_array('Q','R','S')); ---- [[, Y], [Q, R, S]] query error DataFusion error: Optimizer rule 'simplify_expressions' failed caused by Internal error: failed to downcast\. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker select make_array(['C','Z'], null); ``` As a result, only the third case fails, the first case is acceptable but should we expected `[[A, X], []]` to differentiate with `null` can also be discussed ### Describe the solution you'd like Fix the third case and update the comments. Optional: Expect the first case to return `[[A, X], []]` ### Describe alternatives you've considered _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]
