rui-mo commented on code in PR #13613:
URL: https://github.com/apache/gluten/pull/13613#discussion_r4606617603


##########
gluten-substrait/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -613,6 +612,21 @@ object GlutenConfig extends ConfigRegistry {
           nativeConfMap
             .put(SQLConf.LEGACY_TIME_PARSER_POLICY.key, 
v.toUpperCase(Locale.ROOT)))
 
+    // Spark accepts this value in any case, and native code compares it in 
upper case.
+    nativeConfMap.put(
+      SQLConf.MAP_KEY_DEDUP_POLICY.key,
+      conf
+        .getOrElse(
+          SQLConf.MAP_KEY_DEDUP_POLICY.key,
+          SQLConf.MAP_KEY_DEDUP_POLICY.defaultValueString)
+        .toUpperCase(Locale.ROOT)
+    )
+
+    // Spark accepts the codec name in any case, and Velox matches it in lower 
case.
+    conf

Review Comment:
   @pedrumj2 Thanks for looking into this. Does the following work for you?
   
   -  Spark already uppercases `spark.sql.mapKeyDedupPolicy` when parsing it; 
the raw value reaches native code only because Gluten forwards the raw strings 
from `SQLConf.getAllConfs`. So instead of a hand-written toUpperCase, derive 
the value with Spark's own parser: 
`SQLConf.MAP_KEY_DEDUP_POLICY.valueConverter(raw).toString`. That removes 
Gluten's own case handling, also strips the spaces Spark 4.1+ ignores, and 
matches what the planner reads. 
   - Keep toLowerCase for `spark.io.compression.codec`, since Spark lowercases 
it at use and GlutenShuffleUtils already does the same.
   - Case-insensitive parsing in Velox could be a follow-up but would not block 
this PR.



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