Copilot commented on code in PR #12453:
URL: https://github.com/apache/gluten/pull/12453#discussion_r3542895337
##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala:
##########
@@ -233,7 +233,7 @@ object VeloxBackendSettings extends BackendSettingsApi {
}
def validateDataSchema(): Option[String] = {
- if (VeloxConfig.get.parquetUseColumnNames &&
VeloxConfig.get.orcUseColumnNames) {
+ if (VeloxConfig.get.parquetUseColumnNames) {
return None
}
Review Comment:
validateDataSchema now returns early based only on parquetUseColumnNames,
but ORC/DWRF scans now always attach the table schema to LocalFilesNode (and
ORC positional evolution may be active). Skipping validation in those cases can
let unsupported Spark types reach native and fail later at runtime; the guard
should account for ORC/DWRF formats (and Parquet when
parquetUseColumnNames=false), not just the Parquet config.
##########
backends-velox/src/test/scala/org/apache/gluten/execution/FallbackSuite.scala:
##########
@@ -316,27 +316,23 @@ class FallbackSuite extends
VeloxWholeStageTransformerSuite with AdaptiveSparkPl
format =>
Seq("true", "false").foreach {
parquetUseColumnNames =>
- Seq("true", "false").foreach {
- orcUseColumnNames =>
- withSQLConf(
- VeloxConfig.PARQUET_USE_COLUMN_NAMES.key ->
parquetUseColumnNames,
- VeloxConfig.ORC_USE_COLUMN_NAMES.key -> orcUseColumnNames
- ) {
- withTable("test") {
- spark
- .range(100)
- .selectExpr("to_timestamp_ntz(from_unixtime(id % 3)) as
c1", "id as c2")
- .write
- .format(format)
- .saveAsTable("test")
-
- runQueryAndCompare(query) {
- df =>
- val plan = df.queryExecution.executedPlan
- assert(collect(plan) { case g: GlutenPlan => g
}.nonEmpty)
- }
- }
+ withSQLConf(
+ VeloxConfig.PARQUET_USE_COLUMN_NAMES.key -> parquetUseColumnNames
+ ) {
+ withTable("test") {
+ spark
+ .range(100)
+ .selectExpr("to_timestamp_ntz(from_unixtime(id % 3)) as c1",
"id as c2")
+ .write
+ .format(format)
+ .saveAsTable("test")
+
+ runQueryAndCompare(query) {
+ df =>
+ val plan = df.queryExecution.executedPlan
+ assert(collect(plan) { case g: GlutenPlan => g }.nonEmpty)
}
+ }
}
}
}
Review Comment:
In this test, parquetUseColumnNames only affects Parquet scans; when format
is "orc" the loop repeats the same ORC test twice. This adds redundant runtime
without increasing coverage. Consider iterating both values only for Parquet
and running ORC once.
--
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]