-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29641: Upgrade Calcite to 1.42.0 #6523
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
Open
rubenada
wants to merge
40
commits into
apache:master
Choose a base branch
from
rubenada:HIVE-29641
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
114dffb
Bump Calcite version to 1.38, minor code adjustments:
rubenada 139518d
Use non-deprecated version of RexBuilder#makeAbstractCast in HiveSqlS…
rubenada ad26672
HiveHepExtractRelNodeRule: do the conversion using a shuttle, instead…
rubenada 92cd4db
In druid-handler pom-xml: add asm and asm-commons (version 9.7) depen…
rubenada ce10ab8
Update Calcite default charset system property (use UTF16 instead of …
rubenada 4c08d3c
In MaterializationView rules, we cannot use HiveHepExtractRelNodeRule…
rubenada e45f4c3
Fix HiveRelFieldTrimmer#rewriteGBConstantKeys: the condition on its j…
rubenada e4378ca
Add asm dependency to parent pom, trying to fix the javadoc error see…
rubenada 8e663c7
Adjust test plans due to
rubenada fcd2822
Temp: trying to force druid-handler rebuild on Jenkins...
rubenada 9005061
Bump Calcite to 1.42 + required code adjustments:
rubenada f30fc05
Adjust test plans due to change in representation of floating point v…
rubenada 0501cd1
In CalcitePlanner genFilterRelNode: simplify filter condition before …
rubenada e3754ba
Move fix from previous commit as earlier as possible (incorrect binar…
rubenada 348a2eb
Avoid incorrect comparison ($snapshotIdInputRef <= NULL) in HiveAugme…
rubenada e1d74a7
In druid-handler pom add dependency to asm 9.6 to avoid error on java…
rubenada 37692f1
minor: adjust test plan, use ORDER BY ... <ordinal> instead or repeat…
rubenada e188f5b
Identify NOT BETWEEN expression in SearchTransformer to avoid plan ch…
rubenada 9ba25da
Previous change (identify NOT BETWEEN expression in SearchTransformer…
rubenada c115604
Test adjustments: rowcount changes in TestExplainCBOFormattedCliDrive…
rubenada df9725a
Bump maven.shade.plugin.version to 3.6.2 to resolve druid-handler jav…
rubenada 92cd9fc
Override HiveTypeSystemImpl#deriveDecimalDivideType because CALCITE-6…
rubenada 2beae20
Add ASM dependency 9.9.1 for druid handler shade plugin (still trying…
rubenada 306f0ca
Adjust test output stats_histogram.q.out
rubenada fbf8ee7
Rever changes on Jenkinsfile + Fix druid-handler shade ASM error by r…
rubenada 5df3003
Adjust test files: condition reordering, IS [NOT] NULL simplification…
rubenada ed76c18
Due to "[CALCITE-6044] RelMetadataQuery should regard single-row rela…
rubenada 4277d01
Test adjustments (input8.q.out, lineage2.q.out, lineage3.q.out, ppd_c…
rubenada 9d7a343
Adjust test file cross_prod_1.q.out: Equivalent plan; expression "A.v…
rubenada f12d57a
Adjust test file vector_aggregate_9.q.out: Decima cast is not removed.
rubenada 56e7111
Test adjustment vector_coalesce.q.out: equivalent plan, with some IS_…
rubenada 1b3c628
Test adjustment vector_interval_2.q.out: simplified predicates
rubenada 0eebb14
Test adjustment join45.q.out, join47.q.out, mapjoin47.q, smb_mapjoin4…
rubenada 283a073
Test adjustment join46.q.out, mapjoin46.q.out, vectorized_join46.q.ou…
rubenada 779e484
Test adjustment iceberg_bucket_map_join_1.q.out:
rubenada 851e103
Update tests files:
rubenada fdac744
Add org.jooq:joou-java-6 to ql/pom.xml to resolve init-metastore CI e…
rubenada ae05ff9
Add Calcite bug reference
rubenada 7534912
Review:
rubenada 5a4b5ea
Fix TestHivePointLookupOptimizerRule
rubenada File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1458,37 +1458,40 @@ STAGE PLANS: | |
| Map Operator Tree: | ||
| TableScan | ||
| alias: srcpart_double_hour_n0 | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
| Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Filter Operator | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new plan is equivalent but it seems that the simplification didn't lead to a significant improvement. The simplification here seems to have introduced a new |
||
| Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: CAST( UDFToInteger((hr / 2.0D)) AS STRING) (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: _col0 (type: string) | ||
| outputColumnNames: _col0 | ||
| Filter Operator | ||
| predicate: _col0 is not null (type: boolean) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Group By Operator | ||
| keys: _col0 (type: string) | ||
| minReductionHashAggr: 0.4 | ||
| mode: hash | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: _col0 (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Dynamic Partitioning Event Operator | ||
| Target column: hr (string) | ||
| Target Input: srcpart_iceberg | ||
| Partition key expr: hr | ||
| Group By Operator | ||
| keys: _col0 (type: string) | ||
| minReductionHashAggr: 0.4 | ||
| mode: hash | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Target Vertex: Map 1 | ||
| Dynamic Partitioning Event Operator | ||
| Target column: hr (string) | ||
| Target Input: srcpart_iceberg | ||
| Partition key expr: hr | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Target Vertex: Map 1 | ||
| Execution mode: vectorized | ||
| Reducer 2 | ||
| Reduce Operator Tree: | ||
|
|
@@ -1587,21 +1590,24 @@ STAGE PLANS: | |
| Map Operator Tree: | ||
| TableScan | ||
| alias: srcpart_double_hour_n0 | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
| Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Filter Operator | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
| Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: CAST( UDFToInteger((hr / 2.0D)) AS STRING) (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Filter Operator | ||
| predicate: _col0 is not null (type: boolean) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Execution mode: vectorized | ||
| Reducer 2 | ||
| Reduce Operator Tree: | ||
|
|
@@ -3480,37 +3486,40 @@ STAGE PLANS: | |
| Map Operator Tree: | ||
| TableScan | ||
| alias: srcpart_double_hour_n0 | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| filterExpr: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
| Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Filter Operator | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and CAST( UDFToInteger((hr / 2.0D)) AS STRING) is not null) (type: boolean) | ||
| predicate: ((UDFToDouble(hour) = 11.0D) and hr is not null) (type: boolean) | ||
| Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: CAST( UDFToInteger((hr / 2.0D)) AS STRING) (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Filter Operator | ||
| predicate: _col0 is not null (type: boolean) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: _col0 (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Group By Operator | ||
| keys: _col0 (type: string) | ||
| minReductionHashAggr: 0.4 | ||
| mode: hash | ||
| Reduce Output Operator | ||
| key expressions: _col0 (type: string) | ||
| null sort order: z | ||
| sort order: + | ||
| Map-reduce partition columns: _col0 (type: string) | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Select Operator | ||
| expressions: _col0 (type: string) | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Dynamic Partitioning Event Operator | ||
| Target column: hr (string) | ||
| Target Input: srcpart_iceberg | ||
| Partition key expr: hr | ||
| Group By Operator | ||
| keys: _col0 (type: string) | ||
| minReductionHashAggr: 0.4 | ||
| mode: hash | ||
| outputColumnNames: _col0 | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Target Vertex: Map 1 | ||
| Dynamic Partitioning Event Operator | ||
| Target column: hr (string) | ||
| Target Input: srcpart_iceberg | ||
| Partition key expr: hr | ||
| Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE | ||
| Target Vertex: Map 1 | ||
| Execution mode: vectorized | ||
| Reducer 2 | ||
| Execution mode: vectorized | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Relocation is one thing and inclusion in the shaded jar is another. I suppose they included calcite in the shaded jar because the latter is send to workers (running in different JVMs) with a different classpath. Not sure if the Druid module can still work if you remove calcite from shading.
Druid 0.17.1 is using calcite 1.21.0. I highly doubt that all the used APIs are compatible with 1.42.0. In fact, I am rather skeptical about the compatibility with previous upgrades as well (1.25.0 and 1.33.0).
Out of curiosity, I tried running
TestMiniDruidCliDrivertoday and realized that the Druid module is broken since 2021. I send also an email to https://lists.apache.org/thread/qr0xxkvvg4wrlz4kg0bmktldw96yvpn2 explaining the current status and favoring the complete removal of the module.All in all, the changes here do not really matter and we don't have to sweat too much about it since it's only a matter of days before getting rid of the entire module.