You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by px...@apache.org on 2015/10/30 18:17:54 UTC
hive git commit: HIVE-12277: Hive macro results on macro_duplicate.q
different after adding ORDER BY (Pengcheng Xiong, reviewed by Jason Dere)
Repository: hive
Updated Branches:
refs/heads/master fbe31ed27 -> d7d0f6e1e
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/d7d0f6e1
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d7d0f6e1
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d7d0f6e1
Branch: refs/heads/master
Commit: d7d0f6e1e229c1979579df403ed0e2baf9a456e1
Parents: fbe31ed
Author: Pengcheng Xiong <px...@apache.org>
Authored: Fri Oct 30 10:17:12 2015 -0700
Committer: Pengcheng Xiong <px...@apache.org>
Committed: Fri Oct 30 10:17:12 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/d7d0f6e1/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 fc175b9..25c2ff3 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;
@@ -287,6 +288,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/d7d0f6e1/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/d7d0f6e1/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 ####