Skip to content
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

[Feature request]: ⬆️ πŸ†’ πŸ†™ array_sort function with lambda #270

Closed
eruizalo opened this issue Aug 24, 2022 · 0 comments Β· Fixed by #275
Closed

[Feature request]: ⬆️ πŸ†’ πŸ†™ array_sort function with lambda #270

eruizalo opened this issue Aug 24, 2022 · 0 comments Β· Fixed by #275
Labels
API enhancement New feature or request spark_2.4 PR changes to spark 2.4 spark_3.0 PR changes to spark 3.0 spark_3.1 PR changes to spark 3.1 spark_3.2 PR changes to spark 3.2 spark_3.3 PR changes to spark 3.3

Comments

@eruizalo
Copy link
Collaborator

Please, check there is no other feature request like this one to avoid duplicates: see doric issues

  • It seems this feature is not requested yet:
    • YES

Expected Behavior

Currently, there is no spark api function to order an array of structs using other columns or a custom order function, is is necessary to create an expression to do so. It would be nice to have the following functions:

  • array_sort function specifying the custom order columns
  • array_sort function specifying the custom lambda column

Current Behavior (if so)

Use the default ordering function or create an expression

@eruizalo eruizalo added enhancement New feature or request spark_3.0 PR changes to spark 3.0 spark_3.1 PR changes to spark 3.1 spark_3.2 PR changes to spark 3.2 spark_2.4 PR changes to spark 2.4 API spark_3.3 PR changes to spark 3.3 labels Aug 24, 2022
@eruizalo eruizalo changed the title [Feature request]: array_sort function with lambda [Feature request]: ⬆️ πŸ†’ πŸ†™ array_sort function with lambda Aug 24, 2022
eruizalo added a commit to eruizalo/doric that referenced this issue Aug 29, 2022
eruizalo added a commit that referenced this issue Sep 7, 2022
- [feat] ⬆️ array sort function with a lambda of two params. Now we provide an api not available until spark 3.4 (only available through sql expressions).
- [feat] ⬆️ array sort function with a lambda of one param. I have to thank @alfonsorr for this one, as it is his own idea, implementation. This functions is not available in any version of spark (yet).
- [fix] πŸ˜³πŸ’£ !BREAKING_CHANGE: ⚠️ filterWIndex from now on will be only available for spark 3.0+ (we have being testing this function only for spark 3.0+ and the filter function for spark 2.4 does not allow a lambda with 2 variables, so it would fail)
- [fix] 😳 exists array function have being tested only for spark 3.0+, but it is available for all spark versions. Now it will be tested for all versions
- [test] ♻️ createLambda functions have being copied/pasted from spark code in order to test some lambda functions available in doric but not available in older versions of spark api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request spark_2.4 PR changes to spark 2.4 spark_3.0 PR changes to spark 3.0 spark_3.1 PR changes to spark 3.1 spark_3.2 PR changes to spark 3.2 spark_3.3 PR changes to spark 3.3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant