jkosh44 commented on PR #14532:
URL: https://github.com/apache/datafusion/pull/14532#issuecomment-2655302737

   > It might because of `array_coercion` you set for the function is incorrect 
🤔
   
   The query that fails is `array.slt:1221` which is
   ```
   query IT
   select array_element(arrow_cast(make_array(1, 2, 3, 4, 5), 'FixedSizeList(5, 
Int64)'), 2), array_element(arrow_cast(make_array('h', 'e', 'l', 'l', 'o'), 
'FixedSizeList(5, Utf8)'), 3);
   ----
   2 l
   ```
   The error is 
   ```
   External error: query failed: DataFusion error: Execution error: 
array_element does not support type: FixedSizeList(Field { name: "item", 
data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: 
{} }, 5)
   ```
   
   The reason is that `array_element` explicitly does not support 
`FixedSizeList`, and my guess is that many other functions don't as well.
   
https://github.com/apache/datafusion/blob/0a57469f6779c32d5765a7aeed6612e92fa1ef21/datafusion/functions-nested/src/extract.rs#L190-L216
   
   We can't set `array_coercion` to `Some(ListCoercion::FixedSizedListToList)`, 
because we have tests that explicitly test that the inner `FixedSizedList` is 
not coerced to a `List`.
   
   Just to re-iterate, it's the existing behavior that ALL array functions 
coerce the outermost `FixedSizeList` to `List`. The `array()` function is 
already there in `main`. My guess is because most function implementations are 
not set up to correctly handle `FixedSizeList`, so it's coerced to a `List`.


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to