-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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](array-func)support array_match_all/any #40605
[feature](array-func)support array_match_all/any #40605
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
TeamCity be ut coverage result: |
fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java
Show resolved
Hide resolved
...src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayMatchAll.java
Outdated
Show resolved
Hide resolved
private ArrayMatchAll(List<Expression> expressions) { | ||
super("array_match_all", expressions); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
...src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayMatchAll.java
Outdated
Show resolved
Hide resolved
super("array_match_all", arg instanceof Lambda ? arg.child(1).child(0) : arg, new ArrayMap(arg)); | ||
if (!(arg instanceof Lambda)) { | ||
throw new AnalysisException( | ||
String.format("The 1st arg of %s must be lambda but is %s", getName(), arg)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super("array_match_all", arg instanceof Lambda ? arg.child(1).child(0) : arg, new ArrayMap(arg)); | |
if (!(arg instanceof Lambda)) { | |
throw new AnalysisException( | |
String.format("The 1st arg of %s must be lambda but is %s", getName(), arg)); | |
} | |
super("array_match_all", arg instanceof Lambda ? new ArrayMap(arg) : arg); |
...src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayMatchAll.java
Show resolved
Hide resolved
TPC-H: Total hot run time: 38163 ms
|
TPC-DS: Total hot run time: 197908 ms
|
ClickBench: Total hot run time: 31.52 s
|
if (first_outside_null_map->get_data()[row] || | ||
second_outside_null_map->get_data()[row]) { | ||
result_null_column->get_data()[row] = 1; | ||
result_data_column->get_data()[row] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better add comment to explain why return null instead of false, and need to describe the behavior in document
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
@@ -0,0 +1,68 @@ | |||
// Licensed to the Apache Software Foundation (ASF) under one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add document and link to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to detail explain the behavior if encounter null in arrays for the two functions, it's confusing
TPC-H: Total hot run time: 38190 ms
|
TPC-DS: Total hot run time: 197140 ms
|
ClickBench: Total hot run time: 31.29 s
|
.../src/main/java/org/apache/doris/nereids/trees/expressions/visitor/ScalarFunctionVisitor.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java
Outdated
Show resolved
Hide resolved
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 38521 ms
|
TPC-DS: Total hot run time: 198173 ms
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but need document
we need to detail explain the behavior if encounter null in arrays for the two functions, it's confusing |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
ClickBench: Total hot run time: 32.02 s
|
run cloud_p0 |
array_match_all means that every element in array column should all match filter according to lambda expr array_match_any means that any element in array column match filter according to lambda expr
array_match_all means that every element in array column should all match filter according to lambda expr array_match_any means that any element in array column match filter according to lambda expr ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [x] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
Proposed changes
array_match_all
means that every element in array column should all match filter according to lambda expr
array_match_any
means that any element in array column match filter according to lambda expr
Issue Number: close #xxx