henrydavidge opened a new pull request #25666: [SQL][SPARK-28962] Provide index 
argument to filter lambda functions
URL: https://github.com/apache/spark/pull/25666
 
 
   ### What changes were proposed in this pull request?
   
   Lambda functions to array `filter` can now take as input the index as well 
as the element. This behavior matches array `transform`.
   
   
   ### Why are the changes needed?
   See JIRA. It's generally useful, and particularly so if you're working with 
fixed length arrays.
   
   
   ### Does this PR introduce any user-facing change?
   Previously filter lambdas had to look like
   `filter(arr, el -> whatever)`
   
   Now, lambdas can take an index argument as well
   `filter(array, (el, idx) -> whatever)`
   
   
   ### How was this patch tested?
   I added unit tests to `HigherOrderFunctionsSuite`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to