hubgeter opened a new pull request, #69010:
URL: https://github.com/apache/doris/pull/69010
### What problem does this PR solve?
Issue Number: close #29383
Related PR: N/A
Problem Summary:
A bare `INSERT OVERWRITE TABLE t` (no PARTITION clause) on an Iceberg table
always used Iceberg's `ReplacePartitions` (dynamic overwrite).
`ReplacePartitions` only drops files whose own `(specId, partition)` tuple
matches the written files, so after a partition-spec evolution data written
under an older spec is left in place and stale rows survive the overwrite.
This PR adds the session variable `iceberg_partition_overwrite_mode`:
- `dynamic` (default): current behavior, identical to Spark's
`spark.sql.sources.partitionOverwriteMode=dynamic`;
- `static`: the whole table is overwritten via
`OverwriteFiles.overwriteByRowFilter(alwaysTrue())`, identical to Spark's
default `static` mode, so data written under an older partition spec is removed
as well.
The default is `dynamic`, so existing behavior is unchanged.
### Release note
Add a new session variable `iceberg_partition_overwrite_mode` (default
`dynamic`) controlling the scope of `INSERT OVERWRITE` without a `PARTITION`
clause on Iceberg tables. `static` overwrites the whole table (matching Spark's
default); `dynamic` keeps the previous behavior.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [ ] No.
- [x] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]