forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-43137][SQL] Improve ArrayInsert if the position is foldable an…
…d positive ### What changes were proposed in this pull request? Currently, Spark supports the `array_insert` and `array_prepend`. Users insert an element into the head of array is common operation. Considered, we want make array_prepend reuse the implementation of array_insert, but it seems a bit performance worse if the position is foldable and positive. The reason is that always do the check for position is negative or positive, and the code is too long. Too long code will lead to JIT failed. ### Why are the changes needed? Improve ArrayInsert if the position is foldable and positive. ### Does this PR introduce _any_ user-facing change? 'No'. Just change the inner implementation. ### How was this patch tested? Exists test cases. Closes apache#40833 from beliefer/SPARK-43137_new. Authored-by: Jiaan Geng <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
Showing
1 changed file
with
162 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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