Skip to content

Commit 82e3fbf

Browse files
committed
HIVE-29627: Addressed review feedback for coding pattern
1 parent bc5ce85 commit 82e3fbf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/FilterSelectivityEstimator.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ public Double visitCall(RexCall call) {
160160
}
161161

162162
case IS_NULL: {
163-
if (childRel instanceof HiveTableScan) {
164-
HiveTableScan hiveTableScan = (HiveTableScan) childRel;
163+
if (childRel instanceof HiveTableScan hiveTableScan) {
165164
Set<Integer> iRefSet = HiveCalciteUtil.getInputRefs(call);
166165
List<ColStatistics> colStats =
167166
hiveTableScan.getColStat(new ArrayList<>(iRefSet));
@@ -174,7 +173,9 @@ public Double visitCall(RexCall call) {
174173
if (childCardinality >= noOfNulls) {
175174
selectivity = noOfNulls / Math.max(childCardinality, 1);
176175
} else {
177-
HiveConfPlannerContext ctx = childRel.getCluster().getPlanner().getContext().unwrap(HiveConfPlannerContext.class);
176+
HiveConfPlannerContext ctx =
177+
childRel.getCluster().getPlanner().getContext()
178+
.unwrap(HiveConfPlannerContext.class);
178179
String msg = "Invalid statistics: Number of null values > number of tuples. " +
179180
"Consider recomputing statistics for table: " +
180181
((RelOptHiveTable) childRel.getTable()).getHiveTableMD().getFullyQualifiedName();

0 commit comments

Comments
 (0)