parthchandra commented on code in PR #45488:
URL: https://github.com/apache/spark/pull/45488#discussion_r1548686284


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala:
##########
@@ -16,17 +16,20 @@
  */
 package org.apache.spark.sql.execution
 
+import scala.collection.mutable
 import scala.io.Source
-

Review Comment:
   Done



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -333,6 +333,13 @@ object SQLConf {
     .booleanConf
     .createWithDefault(true)
 
+  val EXTENDED_EXPLAIN_PROVIDER = 
buildConf("spark.sql.extendedExplainProvider")

Review Comment:
   Moved to static conf



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -369,6 +371,25 @@ class QueryExecution(
     Utils.redact(sparkSession.sessionState.conf.stringRedactionPattern, 
message)
   }
 
+  def extendedExplainInfo(append: String => Unit, plan: SparkPlan): Unit = {
+    sparkSession.sessionState.conf.extendedExplainProvider match {
+      case Some(generator) =>
+        try {
+          val extensionClass = Utils.classForName(generator)
+          val extension = extensionClass.getConstructor().newInstance()
+            .asInstanceOf[ExtendedExplainGenerator]

Review Comment:
   I don't think it gets called too often. It should only get called in explain 
plan or when the plan is displayed in the UI.
   I can make this a lazy val and load it just once in the class if you think 
that is preferable.



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/ExtendedExplainGenerator.scala:
##########
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution
+
+/**
+ * A trait for a session extension to implement that provides addition explain 
plan
+ * information.
+ */
+

Review Comment:
   removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to