-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](function) Impl the function map_concat like spark #59130
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
base: master
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
mrhhsg
left a comment
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
...ore/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapConcat.java
Outdated
Show resolved
Hide resolved
| if (boundFunction instanceof MapConcat) { | ||
| return processMapConcat((MapConcat) boundFunction); | ||
| } |
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.
should genreate right signature in function, this file should not be changed
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 32263 ms |
TPC-DS: Total hot run time: 172927 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
please link docs PR here then we can merge it. |
|
|
||
| @Override | ||
| public List<FunctionSignature> getSignatures() { | ||
| if (arity() == 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.
arity=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.
arity=0就是map_concat()里没有参数的case,默认是直接返回MapType的,key和value的类型都是NullType:
doris/fe/fe-core/src/main/java/org/apache/doris/nereids/types/MapType.java
Lines 39 to 42 in efdf08e
| private MapType() { | |
| keyType = NullType.INSTANCE; | |
| valueType = NullType.INSTANCE; | |
| } |
也可以不单独分出来,都走compute的逻辑结果也一样,但是看create_map那边有单列出来这里就一样写出来。
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.
Spark也是支持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.
支持的
spark-sql (default)> select map_concat() as m;
{}
| return processCreateMap((CreateMap) boundFunction); | ||
| } | ||
|
|
||
| // type coercion |
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.
dont modify this
| * Compute signatures when arity > 0. | ||
| * Extract key and value types, find common type, and construct signatures. | ||
| */ | ||
| private List<FunctionSignature> computeNonEmptySignatures() { |
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.
没必要再单独抽一个函数出来了。
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 32526 ms |
TPC-DS: Total hot run time: 174162 ms |
ClickBench: Total hot run time: 26.8 s |
Fix #51706
What problem does this PR solve?
Issue Number: close #xxx
Fix issue: #51706
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)