This is an automated email from the ASF dual-hosted git repository.

felixybw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new ec87364fdf [MINOR] Avoid using the fields of StructType (#10328)
ec87364fdf is described below

commit ec87364fdf7456efec3c9b58d0f0dca00a2a3b40
Author: Jiaan Geng <[email protected]>
AuthorDate: Tue Aug 5 02:25:46 2025 +0800

    [MINOR] Avoid using the fields of StructType (#10328)
    
    proposes to avoid using the fields of StructType.
    
    StructType implements the Seq[StructField]. Please see the declaration show 
below.
    
    case class StructType(fields: Array[StructField]) extends DataType with 
Seq[StructField] {
      // ignore code
    }
---
 .../apache/gluten/backendsapi/velox/VeloxValidatorApi.scala    |  6 +++---
 .../org/apache/gluten/execution/IcebergScanTransformer.scala   | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala
 
b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala
index c7c53c65c2..15c367628e 100644
--- 
a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala
+++ 
b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxValidatorApi.scala
@@ -71,9 +71,9 @@ class VeloxValidatorApi extends ValidatorApi {
       case map: MapType =>
         doSchemaValidate(map.keyType).orElse(doSchemaValidate(map.valueType))
       case struct: StructType =>
-        struct.fields.foreach {
-          f =>
-            val reason = doSchemaValidate(f.dataType)
+        struct.foreach {
+          field =>
+            val reason = doSchemaValidate(field.dataType)
             if (reason.isDefined) {
               return reason
             }
diff --git 
a/gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala
 
b/gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala
index 0c0fecc98d..4cdc51fe2a 100644
--- 
a/gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala
+++ 
b/gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala
@@ -217,9 +217,9 @@ case class IcebergScanTransformer(
     }
     (icebergType, currentType, sparkType) match {
       case (iceberg: Types.StructType, currentType: Types.StructType, 
sparkStruct: StructType) =>
-        sparkStruct.fields.forall {
-          f =>
-            val currentField = new 
Schema(currentType.fields()).findField(f.name)
+        sparkStruct.forall {
+          sparkField =>
+            val currentField = new 
Schema(currentType.fields()).findField(sparkField.name)
             // Find not exists column
             if (currentField == null) {
               false
@@ -230,8 +230,8 @@ case class IcebergScanTransformer(
                 true
               } else {
                 // Maybe rename column
-                field.name() == f.name &&
-                typesMatch(field.`type`(), currentField.`type`(), f.dataType)
+                field.name() == sparkField.name &&
+                typesMatch(field.`type`(), currentField.`type`(), 
sparkField.dataType)
               }
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to