feat: allow array_slice to take an optional stride parameter#10469
Merged
jayzhan211 merged 5 commits intoapache:mainfrom May 13, 2024
Merged
feat: allow array_slice to take an optional stride parameter#10469jayzhan211 merged 5 commits intoapache:mainfrom
array_slice to take an optional stride parameter#10469jayzhan211 merged 5 commits intoapache:mainfrom
Conversation
jayzhan211
reviewed
May 13, 2024
| } | ||
| }; | ||
| // This pattern does not generate the "fluent expr_fn" style function, it should be provided externally. | ||
| ($UDF:ty, $SCALAR_UDF_FN:ident) => { |
Contributor
There was a problem hiding this comment.
I would recommend to pull out create_function like https://github.com/apache/datafusion/blob/main/datafusion/functions-aggregate/src/macros.rs.
Member
Author
There was a problem hiding this comment.
Applied. This eliminates some duplication of macro codes. Thank you @jayzhan211 .
jayzhan211
reviewed
May 13, 2024
| lit(1), | ||
| lit(2), | ||
| lit(1), | ||
| Some(lit(1)), |
Contributor
There was a problem hiding this comment.
Maybe add the example that has None for stride?
alamb
approved these changes
May 13, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
LGTM -- thank you @jonahgao and @jayzhan211
findepi
pushed a commit
to findepi/datafusion
that referenced
this pull request
Jul 16, 2024
…e#10469) * feat: allow array_slice to take an optional stride parameter * Use ScalarUDF::call * Use create_function and add test * format * fix cargo doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #10424.
Rationale for this change
Based on the draft PR #10450, and reuse the existing
make_udf_functionmacro as much as possible.What changes are included in this PR?
Are these changes tested?
Not sure whether it's necessary to write a test for this.
Are there any user-facing changes?
Yes