Michael-J-Ward opened a new issue, #10425:
URL: https://github.com/apache/datafusion/issues/10425

   ### 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
   
   ```sql
   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;
   ```
   ```console
   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 8
   ```
   
   ### Expected 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`: 
https://github.com/apache/datafusion-python/pull/669


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