-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for extended array slicing with step #12405
Comments
duckdb/duckdb#8087 duckDB also adds the step and negative reverse index |
@lmatz Can you pls take a look? |
I have no bandwidth at the moment. @jetjinser jin do you want to do it? It's ok if you also have no bandwidth at the moment. |
No problem with me, I'll start soon after finishing what I'm currently working on. |
This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned. |
Is your feature request related to a problem? Please describe.
I think this feature will be helpful if I want to get a value from the array every few steps, or reverse the array.
Describe the solution you'd like
The array slicing syntax
arr[lower-bound:upper-bound:step]
is commonly used in many languages (e.g. python), wherestep
is an integer that can be positive or negative. A step of-1
in particular is used to reverse the array.This does not break compatibility, omitting
step
just treats it as a special case of1
.By introducing this feature, we can benefit from the following:
btw,
array_reverse
is not implemented yet.Describe alternatives you've considered
I haven't figured out how to do it yet.
Additional context
array_reverse
.lower-bound:upper-bound
denotion.The text was updated successfully, but these errors were encountered: