hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jd...@apache.org
Subject hive git commit: HIVE-12277: Hive macro results on macro_duplicate.q different after adding ORDER BY (Pengcheng Xiong, reviewed by Jason Dere)
Date Fri, 30 Oct 2015 21:45:13 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 f98c1ea9d -> 9303b2c45


HIVE-12277: Hive macro results on macro_duplicate.q different after adding ORDER BY (Pengcheng
Xiong, reviewed by Jason Dere)


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

Branch: refs/heads/branch-1
Commit: 9303b2c458694802e9cef4099d1958a08ecee050
Parents: f98c1ea
Author: Pengcheng Xiong <pxiong@apache.org>
Authored: Fri Oct 30 10:17:12 2015 -0700
Committer: Jason Dere <jdere@hortonworks.com>
Committed: Fri Oct 30 14:37:19 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java   | 7 +++++++
 ql/src/test/queries/clientpositive/macro_duplicate.q          | 2 +-
 ql/src/test/results/clientpositive/macro_duplicate.q.out      | 4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9303b2c4/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
index 4b2c1ad..3a22218 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDF;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBaseCompare;
 import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge;
+import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMacro;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
@@ -285,6 +286,12 @@ public class ExprNodeGenericFuncDesc extends ExprNodeDesc implements
       }
     }
 
+    if (genericUDF instanceof GenericUDFMacro) {
+      if (funcText != null && !funcText.equals(dest.funcText)) {
+        return false;
+      }
+    }
+
     if (chidren.size() != dest.getChildren().size()) {
       return false;
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/9303b2c4/ql/src/test/queries/clientpositive/macro_duplicate.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/macro_duplicate.q b/ql/src/test/queries/clientpositive/macro_duplicate.q
index dba38b1..f0afd79 100644
--- a/ql/src/test/queries/clientpositive/macro_duplicate.q
+++ b/ql/src/test/queries/clientpositive/macro_duplicate.q
@@ -7,4 +7,4 @@ insert into table macro_testing values (4,5,6);
 create temporary macro math_square(x int) x*x;
 create temporary macro math_add(x int) x+x;
 
-select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a), math_add(b),int(c)
from macro_testing;
\ No newline at end of file
+select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a), math_add(b),int(c)
from macro_testing order by int(c);

http://git-wip-us.apache.org/repos/asf/hive/blob/9303b2c4/ql/src/test/results/clientpositive/macro_duplicate.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/macro_duplicate.q.out b/ql/src/test/results/clientpositive/macro_duplicate.q.out
index 4e62ccb..5e45118 100644
--- a/ql/src/test/results/clientpositive/macro_duplicate.q.out
+++ b/ql/src/test/results/clientpositive/macro_duplicate.q.out
@@ -44,11 +44,11 @@ PREHOOK: Output: database:default
 POSTHOOK: query: create temporary macro math_add(x int) x+x
 POSTHOOK: type: CREATEMACRO
 POSTHOOK: Output: database:default
-PREHOOK: query: select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a),
math_add(b),int(c) from macro_testing
+PREHOOK: query: select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a),
math_add(b),int(c) from macro_testing order by int(c)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@macro_testing
 #### A masked pattern was here ####
-POSTHOOK: query: select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a),
math_add(b),int(c) from macro_testing
+POSTHOOK: query: select math_square(a), math_square(b),factorial(a), factorial(b), math_add(a),
math_add(b),int(c) from macro_testing order by int(c)
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@macro_testing
 #### A masked pattern was here ####


Mime
View raw message