beliefer commented on code in PR #12234:
URL: https://github.com/apache/gluten/pull/12234#discussion_r3360012508


##########
gluten-substrait/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -576,6 +576,16 @@ object GlutenConfig extends ConfigRegistry {
       }
       .foreach { case (k, v) => nativeConfMap.put(k, v) }
 
+    // When `orc.force.positional.evolution=true`, vanilla Spark maps ORC 
columns by
+    // position rather than by name (see OrcUtils.requestedColumnIds). The 
Velox ORC reader
+    // must do the same, otherwise name-based matching against a mismatched 
file schema
+    // reads columns back as null/empty. Override the (Velox) 
orcUseColumnNames session conf
+    // so native reads ORC by position too. Harmless for backends that ignore 
this key.
+    // String literal is used because gluten-substrait cannot depend on 
backends-velox.
+    if (conf.getOrElse("spark.hadoop.orc.force.positional.evolution", 
"false").toBoolean) {

Review Comment:
   `orc.force.positional.evolution` is a query level SQLConf (user can SET). 
`getNativeBackendConf` only runs once during plugin initialization, taking the 
static configuration at startup - if the user sets `SET 
spark.hadoop.orc.force.positional.evolution=true` during the session, the 
backend conf path is not aware at all. And even if it is inserted, 
`createHiveConnectorSessionConfig(veloxCfg_)` during scan will overwrite 
`kOrcUseColumnNamesSession` with the session value. So it only takes effect 
when placed in the session path.



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