You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2016/05/30 14:46:10 UTC

hive git commit: HIVE-13861: Fix up nullability issue that might be created by pull up constants rules (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master c7c4ec4ce -> d17d07ef5


HIVE-13861: Fix up nullability issue that might be created by pull up constants rules (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d17d07ef
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d17d07ef
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d17d07ef

Branch: refs/heads/master
Commit: d17d07ef5f61838e6922b5e81b28f0c8e82e98c7
Parents: c7c4ec4
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Mon May 30 15:45:45 2016 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon May 30 15:45:45 2016 +0100

----------------------------------------------------------------------
 .../optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java  | 2 ++
 .../ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java   | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d17d07ef/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java
index ebfabac..cc318db 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortLimitPullUpConstantsRule.java
@@ -154,7 +154,9 @@ public class HiveSortLimitPullUpConstantsRule extends RelOptRule {
             relBuilder.fields(RelCollations.of(fieldCollations));
     relBuilder.sortLimit(sort.offset == null ? -1 : RexLiteral.intValue(sort.offset),
             sort.fetch == null ? -1 : RexLiteral.intValue(sort.fetch), sortFields);
+    // Create top Project fixing nullability of fields
     relBuilder.project(topChildExprs, topChildExprsFields);
+    relBuilder.convert(sort.getRowType(), false);
 
     call.transformTo(parent.copy(parent.getTraitSet(), ImmutableList.of(relBuilder.build())));
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/d17d07ef/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java
index f071ddd..8333982 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveUnionPullUpConstantsRule.java
@@ -131,7 +131,9 @@ public class HiveUnionPullUpConstantsRule extends RelOptRule {
       relBuilder.project(Pair.left(newChildExprs), Pair.right(newChildExprs));
     }
     relBuilder.union(union.all, union.getInputs().size());
+    // Create top Project fixing nullability of fields
     relBuilder.project(topChildExprs, topChildExprsFields);
+    relBuilder.convert(union.getRowType(), false);
 
     call.transformTo(relBuilder.build());
   }