You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "wankunde (via GitHub)" <gi...@apache.org> on 2026/06/04 08:59:48 UTC

[PR] [CORE] Optimize Iceberg schema field matching [gluten]

wankunde opened a new pull request, #12233:
URL: https://github.com/apache/gluten/pull/12233

   ## What changes are proposed in this pull request?
   
   Why this PR is needed?
   
   In `IcebergScanTransformer.typesMatch()`, the struct type matching logic creates temporary Iceberg `Schema` objects for every Spark field:
   
   ```scala
   new Schema(currentType.fields()).findField(...)
   new Schema(iceberg.fields()).findField(...)
   ```
   
   This repeatedly rebuilds Iceberg schema indexes while checking historical schemas, which can become expensive for wide schemas or tables with many schema versions. In production thread dumps, this shows up in `Schema` / `IndexByName` / `HashMap` initialization during Iceberg scan planning.
   
   Changes in this PR:
   
   This change uses `Types.StructType.field(name)` and `Types.StructType.field(id)` directly when matching nested struct fields.
   
   `Types.StructType` already provides field lookup by name and id, so this avoids constructing temporary `Schema` objects inside the field loop while preserving the existing matching behavior:
   - find the current field by Spark field name
   - find the old schema field by Iceberg field id
   - keep allowing added columns
   - keep detecting renamed columns by comparing field names
   
   ## How was this patch tested?
   
   Test with exist UT
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex GPT-5


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Optimize Iceberg schema field matching [gluten]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12233:
URL: https://github.com/apache/gluten/pull/12233#issuecomment-4620983654

   Run Gluten Clickhouse CI on x86


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org


Re: [PR] [CORE] Optimize Iceberg schema field matching [gluten]

Posted by "wankunde (via GitHub)" <gi...@apache.org>.
wankunde closed pull request #12233: [CORE] Optimize Iceberg schema field matching
URL: https://github.com/apache/gluten/pull/12233


-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org