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

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


The following commit(s) were added to refs/heads/main by this push:
     new fe00966c63 [CORE] Optimize Iceberg schema field matching (#12275)
fe00966c63 is described below

commit fe00966c63d2e6ac31484b3e7f745691cb6d4328
Author: wankun <[email protected]>
AuthorDate: Thu Jun 11 22:10:24 2026 +0800

    [CORE] Optimize Iceberg schema field matching (#12275)
    
    Co-authored-by: WanKun <[email protected]>
---
 .../scala/org/apache/gluten/execution/IcebergScanTransformer.scala  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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 8f6dcda7ed..cc665ba4eb 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
@@ -33,7 +33,7 @@ import 
org.apache.spark.sql.execution.datasources.v2.BatchScanExec
 import org.apache.spark.sql.execution.metric.SQLMetrics
 import org.apache.spark.sql.types.{ArrayType, DataType, StructType}
 
-import org.apache.iceberg.{BaseTable, MetadataColumns, Schema, 
SnapshotSummary, TableProperties}
+import org.apache.iceberg.{BaseTable, MetadataColumns, SnapshotSummary, 
TableProperties}
 import org.apache.iceberg.avro.AvroSchemaUtil
 import org.apache.iceberg.spark.source.{GlutenIcebergSourceUtil, SparkTable}
 import org.apache.iceberg.spark.source.metrics.NumSplits
@@ -271,12 +271,12 @@ case class IcebergScanTransformer(
       case (iceberg: Types.StructType, currentType: Types.StructType, 
sparkStruct: StructType) =>
         sparkStruct.forall {
           sparkField =>
-            val currentField = new 
Schema(currentType.fields()).findField(sparkField.name)
+            val currentField = currentType.field(sparkField.name)
             // Find not exists column
             if (currentField == null) {
               false
             } else {
-              val field = new 
Schema(iceberg.fields()).findField(currentField.fieldId())
+              val field = iceberg.field(currentField.fieldId())
               // The field does not exist in old schema, add column case
               if (field == null) {
                 true


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

Reply via email to