Supporting instance count in ARRAY_POSITION#15170
Supporting instance count in ARRAY_POSITION#15170rongrong merged 1 commit intoprestodb:masterfrom ssaumitra:i-13861
Conversation
|
Fixes #13861 |
...o-main/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java
Outdated
Show resolved
Hide resolved
...o-main/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Hmm - I think we can just return null. Consider this a short hand for an OR which will return null in that situation.
There was a problem hiding this comment.
Let's discuss changing function behavior separately from extending function APIs. What the function should do when array contains null is not in scope of this PR.
There was a problem hiding this comment.
Okay. Kept as-is for now.
|
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions! |
|
Not sure why the tests are still failing. Can you rebase and push again? |
@rongrong I tried that on the weekend. I just rebased and force pushed again. In the future, if a flaky test fails, is there a way to re-run only a selected test in the new setup? |
|
@rongrong They are passing now 👍🏼 |
There was a problem hiding this comment.
Maybe just change the error message to something like 0 is an invalid instance number for array_position or something more obviously stating that 0 is invalid. "cannot take" sounds like "not supported", but I think here we actually mean it's not valid.
There was a problem hiding this comment.
Okay. I have now edited the message, rebased and pushed.
Test plan - Added new tests in
TestArrayOperators. Also ran the existing test suites.