Repository: hive
Updated Branches:
refs/heads/master 3dcd36336 -> 98982e619
HIVE-19079: Add extended query string to Spark job description (Sahil Takiar,
reviewed by Aihua Xu)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/98982e61
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/98982e61
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/98982e61
Branch: refs/heads/master
Commit: 98982e6193ce05111d031bb8d54ce530ae41853f
Parents: 3dcd363
Author: Sahil Takiar
Authored: Mon Apr 2 09:31:38 2018 -0700
Committer: Sahil Takiar
Committed: Tue Jun 5 12:00:34 2018 -0500
--
.../org/apache/hadoop/hive/conf/HiveConf.java | 2 +
.../java/org/apache/hadoop/hive/ql/Driver.java | 8 +-
.../ql/exec/spark/LocalHiveSparkClient.java | 3 +
.../ql/exec/spark/RemoteHiveSparkClient.java| 7 +-
.../hive/ql/exec/spark/TestHiveSparkClient.java | 97
5 files changed, 115 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/hive/blob/98982e61/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
--
diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
index 9004894..cd425aa 100644
--- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
+++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
@@ -1494,6 +1494,8 @@ public class HiveConf extends Configuration {
HIVEQUERYID("hive.query.id", "",
"ID for query being executed (might be multiple per a session)"),
+HIVESPARKJOBNAMELENGTH("hive.spark.jobname.length", 10, "max jobname
length for Hive on " +
+"Spark queries"),
HIVEJOBNAMELENGTH("hive.jobname.length", 50, "max jobname length"),
// hive jar
http://git-wip-us.apache.org/repos/asf/hive/blob/98982e61/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
--
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
index 7d5e7d4..a3dcc3b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -2033,7 +2033,13 @@ public class Driver implements IDriver {
perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.DRIVER_EXECUTE);
boolean noName = StringUtils.isEmpty(conf.get(MRJobConfig.JOB_NAME));
-int maxlen = conf.getIntVar(HiveConf.ConfVars.HIVEJOBNAMELENGTH);
+
+int maxlen;
+if ("spark".equals(conf.getVar(ConfVars.HIVE_EXECUTION_ENGINE))) {
+ maxlen = conf.getIntVar(HiveConf.ConfVars.HIVESPARKJOBNAMELENGTH);
+} else {
+ maxlen = conf.getIntVar(HiveConf.ConfVars.HIVEJOBNAMELENGTH);
+}
Metrics metrics = MetricsFactory.getInstance();
String queryId = queryState.getQueryId();
http://git-wip-us.apache.org/repos/asf/hive/blob/98982e61/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/LocalHiveSparkClient.java
--
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/LocalHiveSparkClient.java
b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/LocalHiveSparkClient.java
index dff3b0f..72ff53e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/LocalHiveSparkClient.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/LocalHiveSparkClient.java
@@ -163,6 +163,9 @@ public class LocalHiveSparkClient implements
HiveSparkClient {
// Execute generated plan.
JavaPairRDD finalRDD = plan.generateGraph();
+// We get the query name for this SparkTask and set it to the description
for the associated
+// Spark job; query names are guaranteed to be unique for each Spark job
because the task id
+// is concatenated to the end of the query name
sc.setJobGroup("queryId = " + sparkWork.getQueryId(),
DagUtils.getQueryName(jobConf));
// We use Spark RDD async action to submit job as it's the only way to get
jobId now.
http://git-wip-us.apache.org/repos/asf/hive/blob/98982e61/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/RemoteHiveSparkClient.java
--
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/RemoteHiveSparkClient.java
b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/RemoteHiveSparkClient.java
index e8f39ae..d31a202 100644
---
a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/RemoteHiveSparkClient.java
+++
b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/RemoteHiveSparkClient.java
@@ -17,6 +17,7 @@
*/
package org.apache.hadoop.hive.ql.exec.spark;
+import com.google.common.annotations.VisibleForTesting;
import com.