weixiuli commented on code in PR #7857:
URL: https://github.com/apache/incubator-gluten/pull/7857#discussion_r1835267461


##########
gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala:
##########
@@ -134,7 +134,11 @@ private[gluten] class GlutenDriverPlugin extends 
DriverPlugin with Logging {
     conf.set(SPARK_SESSION_EXTENSIONS.key, extensions)
 
     // adaptive custom cost evaluator class
-    if (GlutenConfig.getConf.enableGluten && 
GlutenConfig.getConf.enableGlutenCostEvaluator) {
+    val glutenEnabled = conf.getBoolean(GlutenConfig.GLUTEN_ENABLED_KEY, 
GLUTEN_ENABLED_BY_DEFAULT)
+    lazy val enableGlutenCostEvaluator = conf.getBoolean(
+      GlutenConfig.GLUTEN_COST_EVALUATOR_ENABLED,
+      GLUTEN_COST_EVALUATOR_DEFAULT_VALUE)
+    if (glutenEnabled && enableGlutenCostEvaluator) {
       val costEvaluator = 
"org.apache.spark.sql.execution.adaptive.GlutenCostEvaluator"
       conf.set(SQLConf.ADAPTIVE_CUSTOM_COST_EVALUATOR_CLASS.key, costEvaluator)
     }

Review Comment:
   should we only retain the `enableGlutenCostEvaluator`  condition whether to 
enable gluten?  @zml1206 @zhztheplayer 



-- 
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