cloud-fan commented on a change in pull request #32885:
URL: https://github.com/apache/spark/pull/32885#discussion_r651669404
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -73,7 +73,9 @@ case class HashAggregateExec(
// This is for testing. We force TungstenAggregationIterator to fall back to
the unsafe row hash
// map and/or the sort-based aggregation once it has processed a given
number of input rows.
private val testFallbackStartsAt: Option[(Int, Int)] = {
- sqlContext.getConf("spark.sql.TungstenAggregate.testFallbackStartsAt",
null) match {
+ Option(sqlContext).map { sc =>
Review comment:
`InSubqueryExec` already implements `canonicalized` before this PR, so
we need to fix these bugs anyway.
I have an idea to fix this problem in all physical plans:
1. remove `SparkPlan.sqlContext`, so that we can catch all the callers of it
2. add `@transient final val session =
SparkSession.getActiveSession.orNull`, to replace the previous `sqlContext`
3. override `conf` in `SparkPlan`: `if (session != null)
session.sessionState.conf else SQLConf.get`
@peter-toth what do you think? AFAIK the only reason to access
`SparkPlan.sqlContext` at executor side is to read a conf, and we can do that
with `SQLConf.get` at executor side.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]