Add query 19 to TPC-H regression tests#59
Merged
alamb merged 1 commit intoapache:masterfrom Apr 26, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
=======================================
Coverage 76.24% 76.25%
=======================================
Files 134 134
Lines 23051 23053 +2
=======================================
+ Hits 17576 17578 +2
Misses 5475 5475
Continue to review full report at Codecov.
|
alamb
approved these changes
Apr 26, 2021
Contributor
alamb
left a comment
There was a problem hiding this comment.
Looks good to me @Dandandan -- thanks.
In order to get Q19 to work, the optimizer needs to be clever enough to recognize that p_partkey = l_partkey which appears in each of the three clauses is a join predicate. The query shouldn't be doing a CROSS JOIN, it should be doing an INNER JOIN on p_partkey = l_partkey
Note this is Q19:
select
sum(l_extendedprice * (1 - l_discount) ) as revenue
from
lineitem,
part
where
(
p_partkey = l_partkey
and p_brand = ‘[BRAND1]’
and p_container in ( ‘SM CASE’, ‘SM BOX’, ‘SM PACK’, ‘SM PKG’)
and l_quantity >= [QUANTITY1] and l_quantity <= [QUANTITY1] + 10
and p_size between 1 and 5
and l_shipmode in (‘AIR’, ‘AIR REG’)
and l_shipinstruct = ‘DELIVER IN PERSON’
)
or
(
p_partkey = l_partkey
and p_brand = ‘[BRAND2]’
and p_container in (‘MED BAG’, ‘MED BOX’, ‘MED PKG’, ‘MED PACK’)
and l_quantity >= [QUANTITY2] and l_quantity <= [QUANTITY2] + 10
and p_size between 1 and 10
and l_shipmode in (‘AIR’, ‘AIR REG’)
and l_shipinstruct = ‘DELIVER IN PERSON’
)
or
(
p_partkey = l_partkey
and p_brand = ‘[BRAND3]’
and p_container in ( ‘LG CASE’, ‘LG BOX’, ‘LG PACK’, ‘LG PKG’)
and l_quantity >= [QUANTITY3] and l_quantity <= [QUANTITY3] + 10
and p_size between 1 and 15
and l_shipmode in (‘AIR’, ‘AIR REG’)
and l_shipinstruct = ‘DELIVER IN PERSON’
);
Closed
alamb
pushed a commit
that referenced
this pull request
Nov 17, 2024
* Fix duckdb & sqlite character_length scalar unparsing (#59) * Fix duckdb & sqlite character_length scalar unparsing * Add comments * Update CharacterLengthStyle::SQLStandard to CharacterLengthExtractStyle::CharacterLength * Fix clippy error
unkloud
pushed a commit
to unkloud/datafusion
that referenced
this pull request
Mar 23, 2025
H0TB0X420
pushed a commit
to H0TB0X420/datafusion
that referenced
this pull request
Oct 7, 2025
* Update for changes in apache/arrow-rs#2711 * Clippy * Use Vec conversion * Update to DF 13 (apache#59) * [DataFrame] - Add write_csv/write_parquet/write_json to DataFrame (apache#58) * [SessionContext] - Add read_csv/read_parquet/read_avro functions to SessionContext (apache#57) Co-authored-by: Francis Du <me@francis.run> * remove patch from cargo toml * add notes on git submodule for test data Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com> Co-authored-by: Francis Du <me@francis.run>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Closes #58
Rationale for this change
The query failed before because of a missing cross join. The query runs now (but takes an almost infinite time to run because of the cross join, which probably is a bug or missing optimization somewhere in the planner).
What changes are included in this PR?
Add query 19 to TPC-H regression tests
Are there any user-facing changes?
No