github-actions[bot] commented on code in PR #69499:
URL: https://github.com/apache/doris/pull/69499#discussion_r4358174976
##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergWriteSchemaContext.java:
##########
@@ -96,11 +94,12 @@ static IcebergWriteSchemaContext create(Table table, String
tableName,
Objects.requireNonNull(table, "table should not be null");
Objects.requireNonNull(tableName, "tableName should not be null");
Objects.requireNonNull(branchName, "branchName should not be null");
- Schema schema = branchName.isPresent()
- ? resolveBranchSchema(table, branchName.get(), tableName) :
table.schema();
if (branchName.isPresent()) {
- validateBranchWriterSchema(schema, table.schema(),
branchName.get(), tableName);
+ validateTargetBranch(table, branchName.get(), tableName);
}
+ // A branch selects only the parent snapshot / ref. Iceberg validates
a branch write against the
+ // table-current schema and stamps that schema on the new snapshot,
and Spark binds it the same way.
+ Schema schema = table.schema();
Review Comment:
[P1] Preserve the writer generation across overwrite replanning
For a v3 table ordered `[a, b]` with write-defaults `1` and `2`, run `INSERT
OVERWRITE t@branch(br) VALUES (DEFAULT, DEFAULT)`.
`InsertOverwriteTableCommand.run` first pins that schema and `normalizePlan`
produces `InlineTable(1, 2)`. If another Iceberg client commits
`updateSchema().moveFirst("b").commit()` before the inner INSERT starts,
`InsertIntoTableCommand.initPlan` calls `resetConnectorStatementScope()` and
discards both the original schema and metadata identity. It then pins `[b, a]`
while `needNormalizePlan=false` retains those already-expanded literals.
`BindSink.getColumnToChildOutput` maps by ordinal, producing `Sink[b <- 1, a <-
2]`: the defaults are silently written into the wrong columns, and all schema
checks pass against the second pin. Before this change, a table-only reorder
left both branch-head schema pins unchanged. Preserve the outer writer
context/identity across this handoff, or restart normalization from the
original DEFAULT expressions after repinning;
cover the inter-pass reorder with a controlled concurrency test.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]