You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by za...@apache.org on 2022/10/17 07:59:17 UTC
[hive] 02/02: HIVE-26627: Remove HiveRelBuilder.aggregateCall override and refactor callers to use existing public methods (Stamatis Zampetakis reviewed by Krisztian Kasa)
This is an automated email from the ASF dual-hosted git repository.
zabetak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
commit b48c1bf11c4f75ba2c894e4732a96813ddde1414
Author: Stamatis Zampetakis <za...@gmail.com>
AuthorDate: Thu Oct 6 12:35:59 2022 +0200
HIVE-26627: Remove HiveRelBuilder.aggregateCall override and refactor callers to use existing public methods (Stamatis Zampetakis reviewed by Krisztian Kasa)
Closes #3668
---
.../hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java | 8 --------
.../calcite/rules/HiveRewriteToDataSketchesRules.java | 14 ++------------
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java
index 04b3cae88fd..8722da515ae 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelBuilder.java
@@ -53,8 +53,6 @@ import org.apache.hadoop.hive.ql.optimizer.calcite.functions.HiveSqlSumAggFuncti
import org.apache.hadoop.hive.ql.optimizer.calcite.functions.HiveSqlSumEmptyIsZeroAggFunction;
import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFloorDate;
-import com.google.common.collect.ImmutableList;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -241,10 +239,4 @@ public class HiveRelBuilder extends RelBuilder {
}
}
- /** Make the method visible */
- @Override
- public AggCall aggregateCall(SqlAggFunction aggFunction, boolean distinct, boolean approximate, boolean ignoreNulls,
- RexNode filter, ImmutableList<RexNode> orderKeys, String alias, ImmutableList<RexNode> operands) {
- return super.aggregateCall(aggFunction, distinct, approximate, ignoreNulls, filter, orderKeys, alias, operands);
- }
}
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java
index 1fceb65ccae..a726f10d810 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java
@@ -53,7 +53,6 @@ import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.calcite.tools.RelBuilder;
import org.apache.calcite.tools.RelBuilder.AggCall;
import org.apache.hadoop.hive.ql.exec.DataSketchesFunctions;
-import org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelBuilder;
import org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelFactories;
import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveAggregate;
import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveProject;
@@ -540,17 +539,8 @@ public final class HiveRewriteToDataSketchesRules {
RexNode key = orderKey.getKey();
key = rexBuilder.makeCast(getFloatType(), key);
- // @formatter:off
- AggCall aggCall = ((HiveRelBuilder) relBuilder).aggregateCall(
- (SqlAggFunction) getSqlOperator(DataSketchesFunctions.DATA_TO_SKETCH),
- /* distinct */ false,
- /* approximate */ false,
- /* ignoreNulls */ true,
- null,
- ImmutableList.of(),
- null,
- ImmutableList.of(key));
- // @formatter:on
+ SqlAggFunction dataToSketchFunction = (SqlAggFunction) getSqlOperator(DataSketchesFunctions.DATA_TO_SKETCH);
+ AggCall aggCall = relBuilder.aggregateCall(dataToSketchFunction, key).ignoreNulls(true);
relBuilder.aggregate(relBuilder.groupKey(partitionKeys), aggCall);