-
Notifications
You must be signed in to change notification settings - Fork 759
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
feat: support left-related join spilling #14828
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
pr-feature
this PR introduces a new feature to the codebase
label
Mar 4, 2024
Docker Image for PR
|
9 tasks
A large left join test with spilling on databend cloud: SELECT * FROM lineitem as l1 left JOIN lineitem AS o ON (l1.l_orderkey * 1000 = o.l_orderkey) where o.l_orderkey + l1.l_orderkey < 100000 or o.l_orderkey IS NOT DISTINCT FROM null order by o.l_orderkey nulls first limit 10;
SELECT
*
FROM
lineitem AS l1
LEFT JOIN lineitem AS o ON (l1.l_orderkey * 1000 = o.l_orderkey)
WHERE
o.l_orderkey + l1.l_orderkey < 100000
OR o.l_orderkey IS NOT DISTINCT
FROM
NULL
ORDER BY
o.l_orderkey nulls FIRST
LIMIT
10
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ l_orderkey │ l_partkey │ l_suppkey │ l_linenumber │ l_quantity │ l_extendedprice │ l_discount │ l_tax │ l_returnflag │ l_linestatus │ l_shipdate │ l_commitdate │ l_receiptdate │ l_shipinstruct │ l_shipmode │ l_comment │ l_orderkey │ l_partkey │ l_suppkey │ l_linenumber │ l_quantity │ l_extendedprice │ l_discount │ l_tax │ l_returnflag │ l_linestatus │ l_shipdate │ l_commitdate │ l_receiptdate │ l_shipinstruct │ l_shipmode │ l_comment │
│ Int64 │ Int64 │ Int64 │ Int64 │ Decimal(15, 2) │ Decimal(15, 2) │ Decimal(15, 2) │ Decimal(15, 2) │ String │ String │ Date │ Date │ Date │ String │ String │ String │ Nullable(Int64) │ Nullable(Int64) │ Nullable(Int64) │ Nullable(Int64) │ Nullable(Decimal(15, 2)) │ Nullable(Decimal(15, 2)) │ Nullable(Decimal(15, 2)) │ Nullable(Decimal(15, 2)) │ Nullable(String) │ Nullable(String) │ Nullable(Date) │ Nullable(Date) │ Nullable(Date) │ Nullable(String) │ Nullable(String) │ Nullable(String) │
├────────────┼───────────┼───────────┼──────────────┼────────────────┼─────────────────┼────────────────┼────────────────┼──────────────┼──────────────┼────────────┼──────────────┼───────────────┼───────────────────┼────────────┼─────────────────────────────────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼──────────────────────────┼──────────────────┼──────────────────┼────────────────┼────────────────┼────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ 535312001 │ 5445259 │ 195275 │ 4 │ 19.00 │ 22875.62 │ 0.04 │ 0.07 │ N │ O │ 1997-02-20 │ 1997-02-03 │ 1997-03-11 │ TAKE BACK RETURN │ MAIL │ multipliers affix. always ruthless acco │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312001 │ 18451608 │ 201663 │ 5 │ 38.00 │ 59229.84 │ 0.07 │ 0.06 │ N │ O │ 1996-12-16 │ 1997-02-11 │ 1997-01-11 │ COLLECT COD │ FOB │ s poach furiously blithe │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312001 │ 16167667 │ 417684 │ 6 │ 37.00 │ 64152.82 │ 0.05 │ 0.06 │ N │ O │ 1997-02-18 │ 1997-02-07 │ 1997-02-23 │ DELIVER IN PERSON │ AIR │ e regular dolphins. furiously f │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 16497275 │ 497276 │ 1 │ 7.00 │ 8900.15 │ 0.01 │ 0.07 │ N │ O │ 1997-06-25 │ 1997-06-06 │ 1997-07-23 │ NONE │ RAIL │ ully ironic deposits. slyly regular ide │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 9697305 │ 197324 │ 2 │ 1.00 │ 1301.82 │ 0.09 │ 0.04 │ N │ O │ 1997-04-29 │ 1997-05-29 │ 1997-05-09 │ COLLECT COD │ MAIL │ ilent pinto beans? ironically bli │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 2602103 │ 852106 │ 3 │ 27.00 │ 27134.19 │ 0.08 │ 0.02 │ N │ O │ 1997-05-08 │ 1997-05-02 │ 1997-05-22 │ TAKE BACK RETURN │ REG AIR │ . special ideas unwind care │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 13536823 │ 36850 │ 4 │ 48.00 │ 89239.20 │ 0.07 │ 0.02 │ N │ O │ 1997-04-20 │ 1997-05-30 │ 1997-04-29 │ NONE │ SHIP │ the furiously silent Tiresias. │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 13377863 │ 377864 │ 5 │ 7.00 │ 13581.40 │ 0.05 │ 0.06 │ N │ O │ 1997-03-25 │ 1997-05-16 │ 1997-04-15 │ DELIVER IN PERSON │ FOB │ he quickly pending platelets are furiously │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 1727912 │ 727913 │ 6 │ 9.00 │ 17458.47 │ 0.08 │ 0.00 │ N │ O │ 1997-04-12 │ 1997-05-28 │ 1997-05-02 │ TAKE BACK RETURN │ SHIP │ y. blithely ironi │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
│ 535312101 │ 1001618 │ 501621 │ 7 │ 20.00 │ 30391.20 │ 0.00 │ 0.00 │ N │ O │ 1997-04-02 │ 1997-06-02 │ 1997-04-06 │ NONE │ FOB │ le slyly after the ironic packages. │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │ NULL │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
10 rows read in 1851.514 sec. Processed 1.2 billion rows, 215.47 GiB (648.16 thousand rows/s, 119.17 MiB/s) |
Dousir9
reviewed
Mar 5, 2024
src/query/service/src/pipelines/processors/transforms/hash_join/spill_common.rs
Show resolved
Hide resolved
Dousir9
approved these changes
Mar 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ci-cloud
Build docker image for cloud test
pr-feature
this PR introduces a new feature to the codebase
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.
Tests
Type of change
This change is