neilconway opened a new issue, #25950:
URL: https://github.com/apache/datafusion/issues/25950

   ### Describe the bug
   
   `array_repeat` with a list as its first argument fails with an Arrow error 
when the list's element field is non-nullable or has a name other than the 
default `item`. The same call on a list with the default element field works.
   
   ### To Reproduce
   
   ```sql
   CREATE TABLE t AS SELECT
     make_array(1, 2) AS a,
     arrow_cast(make_array(1, 2), 'List(non-null Int64)') AS b,
     arrow_cast(make_array(1, 2), 'List(Int64, field: ''element'')') AS c;
   
   SELECT array_repeat(a, 2) FROM t;
   -- [[1, 2], [1, 2]]
   
   SELECT array_repeat(b, 2) FROM t;
   -- Arrow error: Invalid argument error: ListArray expected data type 
List(non-null Int64) got List(Int64) for "item"
   
   SELECT array_repeat(c, 2) FROM t;
   -- Arrow error: Invalid argument error: ListArray expected data type 
List(Int64, field: 'element') got List(Int64) for "item"
   ```
   
   `LargeList(non-null Int64)` input fails the same way: `LargeListArray 
expected data type LargeList(non-null Int64) got LargeList(Int64) for "item"`.
   
   ### Expected behavior
   
   `array_repeat(b, 2)` and `array_repeat(c, 2)` return `[[1, 2], [1, 2]]`, 
like `array_repeat(a, 2)`.
   
   ### Additional context
   
   Reproduced on `main` at commit 2b1fcae86, in both release and debug builds. 
#24347 covered a similar problem in `array_append`, `array_prepend` and 
`array_replace*`.
   
   *This bug report was generated by Claude.*
   


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