-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-26524: Use Calcite to remove sections of a query plan known never produces rows #3588
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
Merged
kasakrisz
merged 47 commits into
apache:master
from
kasakrisz:HIVE-26524-master-empty-op
Oct 7, 2022
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
8b921a1
HIVE-26524: Use Calcite to remove sections of a query plan known neve…
kasakrisz 5b19c25
fix code style issues
kasakrisz 38c7c7b
fix javadocs
kasakrisz f055805
cast nulls to the types defined in the schema to handle grand total a…
kasakrisz 479f11f
add type params like char(10)
kasakrisz 6065079
handle withing group clause in CBO plan
kasakrisz 1e145ba
handle null literal in empty plan
kasakrisz bb16a0d
handle values in HiveOpConverter
kasakrisz 5eb640b
update q tests
kasakrisz 4b38c04
refac: extract cast
kasakrisz 2e2f713
revert HiveRelFieldTrimmer
kasakrisz 4a78519
support Within group in HiveRelFieldTrimmer
kasakrisz ccf61f3
revert q.out change
kasakrisz 76f51a1
fix HiveRewriteToDataSketchesRules percentile_disc
kasakrisz 1686372
update q.out
kasakrisz 1d6e7f3
cleanup
kasakrisz 8c7be3d
fix grand total aggregate on empty values in HiveOpConverter
kasakrisz c24ccc4
add ColumnExpression Map to select op
kasakrisz 1854845
cleanup
kasakrisz 24e0aaf
handle full outer join on tables with not null constraints defined
kasakrisz 3be92cb
Update ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/…
kasakrisz 353830d
Update ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/transl…
kasakrisz ca18f9e
change formal parameter list indentation
kasakrisz f94172a
copy latest version of PruneEmptyRules from CALCITE-5294
kasakrisz 94f876d
make convertFieldCollationsToASTNode private
kasakrisz 0e17035
copy latest version of PruneEmptyRules from CALCITE-5294
kasakrisz cb3223b
track Calcite contributions
kasakrisz 3ce2418
add UT
kasakrisz a4ac4a5
copy latest version of PruneEmptyRules from CALCITE-5294
kasakrisz 2f041d5
format TestASTConverter
kasakrisz 332b224
copy latest version of PruneEmptyRules from CALCITE-5294
kasakrisz 8f3401a
remove unused import
kasakrisz 322f188
always create new instance in HiveValues.copy
kasakrisz cc04fb1
fix links in javadocs
kasakrisz aec509a
support complex types in empty plan
kasakrisz cfe1297
remove redundant LOG msg
kasakrisz 1f23baa
refactor HiveValuesVisitor
kasakrisz 2cbcaa5
HiveRemoveEmptySingleRules: only Hive* ops are supported
kasakrisz dfd04cc
ASTConverter: throw exception when trying to convert non-empty HiveVa…
kasakrisz ee55eb7
TestASTConverter: remove redundant assert and add assertion for compl…
kasakrisz ad73b48
ASTConverter.emptyPlan: javadocs
kasakrisz c977888
HiveValuesVisitor: javadocs
kasakrisz 0abb5a2
ASTConverter: fix javadocs
kasakrisz 1579377
HiveRemoveEmptySingleRules: support semijoin
kasakrisz 0f910f7
use isCBOExecuted() instead of query the config HIVE_CBO_ENABLED
kasakrisz 4cb4e69
add CBO test for within group
kasakrisz 673b4ea
transform Within group clause in ASTConverter
kasakrisz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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
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
46 changes: 46 additions & 0 deletions
46
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveValues.java
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.hive.ql.optimizer.calcite.reloperators; | ||
|
|
||
| import com.google.common.collect.ImmutableList; | ||
| import org.apache.calcite.plan.RelOptCluster; | ||
| import org.apache.calcite.plan.RelTraitSet; | ||
| import org.apache.calcite.rel.RelNode; | ||
| import org.apache.calcite.rel.core.Values; | ||
| import org.apache.calcite.rel.type.RelDataType; | ||
| import org.apache.calcite.rex.RexLiteral; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Subclass of {@link org.apache.calcite.rel.core.Values}. | ||
| * Specialized to Hive engine. | ||
| */ | ||
| public class HiveValues extends Values { | ||
|
|
||
| public HiveValues(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, | ||
| RelTraitSet traits) { | ||
| super(cluster, rowType, tuples, traits); | ||
| } | ||
|
|
||
| @Override | ||
| public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { | ||
| return new HiveValues(getCluster(), getRowType(), tuples, getTraitSet()); | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.