yaooqinn commented on code in PR #10093:
URL: 
https://github.com/apache/incubator-gluten/pull/10093#discussion_r2179775438


##########
gluten-core/src/main/scala/org/apache/spark/sql/internal/SparkConfigUtil.scala:
##########
@@ -50,15 +50,15 @@ object SparkConfigUtil {
   }
 
   def get[T](conf: SparkConf, entry: ConfigEntry[T]): T = {
-    entry.valueConverter(conf.get(entry.key, entry.defaultValueString))
+    entry.valueConverter(checkUndefined(conf.get(entry.key, 
entry.defaultValueString)))

Review Comment:
   Instead of calling `checkUndefined` every time, we can modify like this
   ```diff
   -    entry.valueConverter(conf.get(entry.key, entry.defaultValueString))
   +    conf
   +      .getOption(entry.key)
   +      .map(entry.valueConverter)
   +      .getOrElse(entry.defaultValue.getOrElse(None).asInstanceOf[T])
   ```



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