ulysses-you commented on code in PR #45282:
URL: https://github.com/apache/spark/pull/45282#discussion_r1505216648


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala:
##########
@@ -87,7 +87,7 @@ case class AdaptiveSparkPlanExec(
 
   // The logical plan optimizer for re-optimizing the current logical plan.
   @transient private val optimizer = new AQEOptimizer(conf,
-    session.sessionState.adaptiveRulesHolder.runtimeOptimizerRules)
+    context.session.sessionState.adaptiveRulesHolder.runtimeOptimizerRules)

Review Comment:
   I face an issue so change this
   ```
   py4j.protocol.Py4JJavaError: An error occurred while calling o6764.fit.
   : java.lang.NullPointerException: Cannot invoke 
"org.apache.spark.sql.SparkSession.sessionState()" because the return value of 
"org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.session()" is 
null
        at 
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.<init>(AdaptiveSparkPlanExec.scala:90)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at 
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$makeCopy$6(TreeNode.scala:743)
        at 
org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(origin.scala:83)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode.makeCopy(TreeNode.scala:742)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode.clone(TreeNode.scala:798)
        at 
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.clone(AdaptiveSparkPlanExec.scala:502)
        at 
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.clone(AdaptiveSparkPlanExec.scala:67)
        at 
org.apache.spark.sql.execution.columnar.InMemoryRelation.innerChildren(InMemoryRelation.scala:418)
        at 
org.apache.spark.sql.catalyst.trees.TreeNode.generateTreeString(TreeNode.scala:1012)
   ```



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to