-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
See reproduction for specific example that triggers the panic.
Some combination of a column with varying size arrays, a negative start index, a positive end index, and stride explicitly set to one triggers the panic.
To Reproduce
CREATE TEMPORARY VIEW data3 AS VALUES ([1.0, 2.0, 3.0, 3.0]), ([4.0, 5.0, 3.0]), ([6.0]);
❯ select * from data3;
+----------------------+
| column1 |
+----------------------+
| [1.0, 2.0, 3.0, 3.0] |
| [4.0, 5.0, 3.0] |
| [6.0] |
+----------------------+
❯ select array_slice(column1, -1, 2, 1) from data3;thread 'main' panicked at /Users/andy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-data-51.0.0/src/transform/primitive.rs:31:43:
range end index 9 out of range for slice of length 8Expected behavior
Doesn't panic. Works just like the stride=1 default.
+-----------------------------------------------+
| array_slice(data3.column1,Int64(-1),Int64(2)) |
+-----------------------------------------------+
| [] |
| [] |
| [6.0] |
Additional context
This was found upgrading datafusion-python: apache/datafusion-python#669
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working