You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ho...@apache.org on 2026/06/11 14:10:32 UTC

(gluten) branch main updated: [CORE] Optimize Iceberg schema field matching (#12275)

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 <wa...@163.com>
AuthorDate: Thu Jun 11 22:10:24 2026 +0800

    [CORE] Optimize Iceberg schema field matching (#12275)
    
    Co-authored-by: WanKun <wa...@bilibili.com>
---
 .../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: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org