-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In case of array_repeat, when the count variable is not of type Int64, it gives error.
In case of Int32, Int16, Int8, we should automatically convert it into Int64.
To Reproduce
select array_repeat(1 ,arrow_cast(2,'Int32'));
getting error:
Internal error: could not cast value to arrow_array::array::primitive_array::PrimitiveArray<arrow_array::types::Int64Type>.
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
Expected behavior
select array_repeat(1,2);
+---------------------------------+
| array_repeat(Int64(1),Int64(2)) |
+---------------------------------+
| [1, 1] |
+---------------------------------+
1 row(s) fetched.
Additional context
I think, for count variable we should upcast to Int64 if it is of type Int8, Int16, or Int32, preventing the error.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working