You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pr...@apache.org on 2018/05/23 09:54:36 UTC
hive git commit: HIVE-19613: GenericUDTFGetSplits should handle fetch
task with temp table rewrite (Prasanth Jayachandran reviewed by Gunther
Hagleitner, Jason Dere)
Repository: hive
Updated Branches:
refs/heads/master dba2ebf81 -> 4f789cc6f
HIVE-19613: GenericUDTFGetSplits should handle fetch task with temp table rewrite (Prasanth Jayachandran reviewed by Gunther Hagleitner, Jason Dere)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4f789cc6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4f789cc6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4f789cc6
Branch: refs/heads/master
Commit: 4f789cc6ffa23c1229a0fb75484e8a94eb09f087
Parents: dba2ebf
Author: Prasanth Jayachandran <pr...@apache.org>
Authored: Wed May 23 02:53:53 2018 -0700
Committer: Prasanth Jayachandran <pr...@apache.org>
Committed: Wed May 23 02:53:53 2018 -0700
----------------------------------------------------------------------
.../hive/ql/udf/generic/GenericUDTFGetSplits.java | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/4f789cc6/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
index 715b851..f0e4f46 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
@@ -241,6 +241,7 @@ public class GenericUDTFGetSplits extends GenericUDTF {
conf.setBoolean(TezSplitGrouper.TEZ_GROUPING_NODE_LOCAL_ONLY, true);
// Tez/LLAP requires RPC query plan
HiveConf.setBoolVar(conf, ConfVars.HIVE_RPC_QUERY_PLAN, true);
+ HiveConf.setBoolVar(conf, ConfVars.HIVE_QUERY_RESULTS_CACHE_ENABLED, false);
try {
jc = DagUtils.getInstance().createConfiguration(conf);
@@ -270,14 +271,20 @@ public class GenericUDTFGetSplits extends GenericUDTF {
}
List<Task<?>> roots = plan.getRootTasks();
Schema schema = convertSchema(plan.getResultSchema());
-
+ boolean fetchTask = plan.getFetchTask() != null;
+ TezWork tezWork;
if (roots == null || roots.size() != 1 || !(roots.get(0) instanceof TezTask)) {
- throw new HiveException("Was expecting a single TezTask.");
+ // fetch task query
+ if (fetchTask) {
+ tezWork = null;
+ } else {
+ throw new HiveException("Was expecting a single TezTask or FetchTask.");
+ }
+ } else {
+ tezWork = ((TezTask) roots.get(0)).getWork();
}
- TezWork tezWork = ((TezTask)roots.get(0)).getWork();
-
- if (tezWork.getAllWork().size() != 1) {
+ if (tezWork == null || tezWork.getAllWork().size() != 1) {
String tableName = "table_"+UUID.randomUUID().toString().replaceAll("[^A-Za-z0-9 ]", "");