You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by we...@apache.org on 2021/11/11 04:41:40 UTC

[spark] branch master updated: [SPARK-36799][SQL] Pass queryExecution name in CLI

This is an automated email from the ASF dual-hosted git repository.

wenchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new a406e41  [SPARK-36799][SQL] Pass queryExecution name in CLI
a406e41 is described below

commit a406e41c9f59b46107ba36e8ed5e47c9c27e8773
Author: sychen <sy...@ctrip.com>
AuthorDate: Thu Nov 11 12:40:46 2021 +0800

    [SPARK-36799][SQL] Pass queryExecution name in CLI
    
    ### What changes were proposed in this pull request?
    In CLI, call `SQLExecution.withNewExecutionId` and specify `cli` as `executionName` so that `QueryExecutionListener` can get the query.
    ### Why are the changes needed?
    Now when in spark-sql CLI, `QueryExecutionListener` can receive command , but not select query.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    manual test.
    
    Closes #34041 from cxzl25/SPARK-36799.
    
    Authored-by: sychen <sy...@ctrip.com>
    Signed-off-by: Wenchen Fan <we...@databricks.com>
---
 .../scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
index f42803d..18a0e57 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala
@@ -65,7 +65,7 @@ private[hive] class SparkSQLDriver(val context: SQLContext = SparkSQLEnv.sqlCont
       }
       context.sparkContext.setJobDescription(substitutorCommand)
       val execution = context.sessionState.executePlan(context.sql(command).logicalPlan)
-      hiveResponse = SQLExecution.withNewExecutionId(execution) {
+      hiveResponse = SQLExecution.withNewExecutionId(execution, Some("cli")) {
         hiveResultString(execution.executedPlan)
       }
       tableSchema = getResultSetSchema(execution)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org