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

[Improve](array-func)improve array union support multi params #24327

Merged
merged 7 commits into from
Sep 20, 2023

Conversation

amorynan
Copy link
Contributor

Proposed changes

Issue Number: close #xxx
Now we just support array union with two arrays

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

@amorynan
Copy link
Contributor Author

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.96% (7968/21556)
Line Coverage: 28.93% (63837/220662)
Region Coverage: 27.87% (33147/118919)
Branch Coverage: 24.43% (16999/69592)
Coverage Report: http://coverage.selectdb-in.cc/coverage/7d4380de09b436d92f05c0e45bd7ed3e3617387a_7d4380de09b436d92f05c0e45bd7ed3e3617387a/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 48.7 seconds
stream load tsv: 594 seconds loaded 74807831229 Bytes, about 120 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 28.9 seconds inserted 10000000 Rows, about 346K ops/s
storage size: 17162290689 Bytes

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.96% (7968/21558)
Line Coverage: 28.93% (63848/220721)
Region Coverage: 27.87% (33154/118958)
Branch Coverage: 24.43% (17006/69614)
Coverage Report: http://coverage.selectdb-in.cc/coverage/5caff873b333586c520cb25d9e03c1539bbe9518_5caff873b333586c520cb25d9e03c1539bbe9518/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.08 seconds
stream load tsv: 612 seconds loaded 74807831229 Bytes, about 116 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 28.7 seconds inserted 10000000 Rows, about 348K ops/s
storage size: 17162555795 Bytes

@xiaokang xiaokang added dev/2.0.2 usercase Important user case type label labels Sep 14, 2023
[['array_union'], 'ARRAY_VARCHAR', ['ARRAY_VARCHAR', 'ARRAY_VARCHAR'], ''],
[['array_union'], 'ARRAY_STRING', ['ARRAY_STRING', 'ARRAY_STRING'], ''],
[['array_union'], 'ARRAY_BOOLEAN', ['ARRAY_BOOLEAN', 'ARRAY_BOOLEAN', '...'], ''],
[['array_union'], 'ARRAY_TINYINT', ['ARRAY_TINYINT', 'ARRAY_TINYINT', '...'], ''],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should update org.apache.doris.nereids.trees.expressions.functions.scalar.ArrayUnion to let it support multi param in Nereids too

if (entry.get_mapped() == params.size()) {
if constexpr (operation == MapOperation::INTERSECT) {
if (entry.get_mapped() == params.size()) {
++dst_off;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same code as line 99~103

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make micro define

if (!set.find(elem)) {
set.insert(elem);
return true;
void apply(Map& map, const int arg_idx, const int row_idx,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. row_idx better use 64bit instead int.
  2. const int == int?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe size_t is better ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@xy720 xy720 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why calculate multi array union need a map structure? Set is not enough?

@amorynan
Copy link
Contributor Author

Why calculate multi array union need a map structure? Set is not enough?

because MapImpl can apply const ColumnArrayExecutionDatas params, but SetImpl just apply one ColumnArrayExecutionData

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@amorynan
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.84% (7978/21653)
Line Coverage: 28.86% (64003/221770)
Region Coverage: 27.77% (33194/119515)
Branch Coverage: 24.38% (17040/69900)
Coverage Report: http://coverage.selectdb-in.cc/coverage/4b774ea9e7d3fea3bf616e43c728129500a66705_4b774ea9e7d3fea3bf616e43c728129500a66705/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.27 seconds
stream load tsv: 600 seconds loaded 74807831229 Bytes, about 118 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 28.7 seconds inserted 10000000 Rows, about 348K ops/s
storage size: 17162510316 Bytes

morrySnow
morrySnow previously approved these changes Sep 18, 2023
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 18, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@amorynan amorynan requested a review from morrySnow September 18, 2023 10:01
@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.82% (7979/21672)
Line Coverage: 28.84% (64018/221948)
Region Coverage: 27.73% (33224/119799)
Branch Coverage: 24.36% (17029/69916)
Coverage Report: http://coverage.selectdb-in.cc/coverage/2234a7a31488e4c32dff3f1923a4102c20d26d3f_2234a7a31488e4c32dff3f1923a4102c20d26d3f/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 46.19 seconds
stream load tsv: 596 seconds loaded 74807831229 Bytes, about 119 MB/s
stream load json: 21 seconds loaded 2358488459 Bytes, about 107 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 28.9 seconds inserted 10000000 Rows, about 346K ops/s
storage size: 17162185221 Bytes

@xiaokang
Copy link
Contributor

run buildall

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.83% (7981/21672)
Line Coverage: 28.86% (64056/221948)
Region Coverage: 27.75% (33247/119799)
Branch Coverage: 24.38% (17043/69916)
Coverage Report: http://coverage.selectdb-in.cc/coverage/867f06795d2ca7ddb186352839f4ebad7c330ca4_867f06795d2ca7ddb186352839f4ebad7c330ca4/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.71 seconds
stream load tsv: 599 seconds loaded 74807831229 Bytes, about 119 MB/s
stream load json: 21 seconds loaded 2358488459 Bytes, about 107 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 28.6 seconds inserted 10000000 Rows, about 349K ops/s
storage size: 17162360025 Bytes

@amorynan
Copy link
Contributor Author

run p0

@amorynan
Copy link
Contributor Author

run p1

@amorynan
Copy link
Contributor Author

@shuke987

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 20, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

@xiaokang xiaokang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/2.0.2-merged merge_conflict reviewed usercase Important user case type label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants