LuciferYang commented on code in PR #13149:
URL: https://github.com/apache/gluten/pull/13149#discussion_r4130864467


##########
gluten-core/src/main/scala/org/apache/gluten/extension/GlutenSessionExtensions.scala:
##########
@@ -44,7 +44,7 @@ private[gluten] class GlutenSessionExtensions
       session =>
         val glutenEnabledForThread =
           
Option(session.sparkContext.getLocalProperty(GLUTEN_ENABLE_FOR_THREAD_KEY))
-            .forall(_.toBoolean)
+            .forall(isEnabledForThread)

Review Comment:
   `getLocalProperty` shows up in a few places, but each reads a different key 
(`SQLExecution.EXECUTION_ID_KEY`, `sql.streaming.queryId`) with its own 
handling. `gluten.enabledForCurrentThread` is only read here, so a shared 
helper for it would have a single caller and would not consolidate the others. 
I did pull the parsing into `isEnabledForThread` so the invalid-value contract 
is unit-tested. If you have specific call sites in mind that share the same key 
and parse, point me at them and I will fold them in.



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