-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
These queries will give errors or incorrect results.
To Reproduce
Run queries in CLI:
DataFusion CLI v38.0.0
> select array_slice([1,2,3], 1, NULL);
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
> select array_slice([1,2,3], -100, 1) r;
+----+
| r |
+----+
| [] |
+----+
1 row(s) fetched.
Elapsed 0.006 seconds.
> select array_slice([1,2,3], 1, 1, -1) r;
+----+
| r |
+----+
| [] |
+----+Expected behavior
The results of DuckDB look correct to me.
v0.10.3-dev779 d26007417b
D select array_slice([1,2,3], 1, NULL);
┌────────────────────────────────────────────────┐
│ array_slice(main.list_value(1, 2, 3), 1, NULL) │
│ int32[] │
├────────────────────────────────────────────────┤
│ │
└────────────────────────────────────────────────┘
D select array_slice([1,2,3], -100, 1);
┌────────────────────────────────────────────────┐
│ array_slice(main.list_value(1, 2, 3), -100, 1) │
│ int32[] │
├────────────────────────────────────────────────┤
│ [1] │
└────────────────────────────────────────────────┘
D select array_slice([1,2,3], 1, 1, -1) r;
┌─────────┐
│ r │
│ int32[] │
├─────────┤
│ [1] │
└─────────┘Additional context
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't working