adiranjan25 commented on issue #19188:
URL: https://github.com/apache/iceberg/issues/19188#issuecomment-7270273836

   I'd like to investigate and contribute a fix for this issue.
   
   I reviewed the reported Spark 3.5 reproduction and traced the `add_files` 
procedure through `AddFilesProcedure`, `BaseProcedure`, and `SparkTableUtil`.
   
   The current import paths use `targetTable.newAppend()` without explicitly 
selecting the requested branch. This appears consistent with the reported 
behavior, where importing files into `db.t.branch_b` succeeds but advances 
`main` instead.
   
   I also checked the related history. PR #17040 previously proposed branch 
support for `add_files` but was closed without merging. Branch support for 
`rewrite_data_files` was merged separately in #14964 and #15067. I did not find 
an active PR directly addressing #19188.
   
   My proposed approach is to:
   
   1. Add regression coverage demonstrating that `add_files` must not modify 
`main` when a branch is specified.
   2. Check both file-path and catalog-table import paths, including 
partitioned and unpartitioned tables.
   3. Validate branch existence and ensure a failed operation does not fall 
back silently to `main`.
   4. Investigate the other affected procedures separately, so we avoid 
introducing incompatible semantics through a broad shared change.
   
   I will first establish the baseline failures and then share a focused, 
validated fix. Maintainer guidance on whether procedures should honor 
branch-qualified identifiers, accept an explicit `branch` parameter, or reject 
unsupported branch targets would be appreciated.


-- 
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]

Reply via email to