Skip to content

Commit 4450fac

Browse files
committed
[fix](iceberg) Use indexed partition source lookup
### What problem does this PR solve? Issue Number: N/A Problem Summary: Per-file identity partition planning searched every top-level schema column for each partition field. Resolve the field-id through Iceberg's top-level struct index so planning no longer scales with schema width. ### Release note None ### Check List (For Author) - Test: Unit Test - IcebergPartitionUtilsTest - IcebergScanPlanProviderTest - IcebergSchemaUtilsTest - Behavior changed: No - Does this need documentation: No
1 parent 4e60704 commit 4450fac

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergPartitionUtils.java‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,8 @@ private static String toPartitionFieldName(Schema schema, PartitionSpec spec, St
191191
* mistaken for the top-level column {@code id}: the engine can only materialize a top-level column.
192192
*/
193193
static String topLevelSourceColumnName(Schema schema, int sourceId) {
194-
for (NestedField column : schema.columns()) {
195-
if (column.fieldId() == sourceId) {
196-
return column.name();
197-
}
198-
}
199-
return null;
194+
NestedField column = schema.asStruct().field(sourceId);
195+
return column == null ? null : column.name();
200196
}
201197

202198
/** The spec's <em>identity</em> partition over the top-level column {@code name}, or null. */

0 commit comments

Comments
 (0)