Repository navigation
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#64304 (introduced the regression), apache#56413 (original implementation) Problem Summary: Rewrite planning resolves target-file-size-bytes, but the connector group drops it and each task inherits the caller's writer target. Carry validated task-session settings with every rewrite group and apply them to its private session before planning. Preserve the effective procedure default and the caller's original settings, and advance the connector API to 31.0. ### Release note Iceberg rewrite_data_files now applies its target-file-size-bytes option, including the default 512 MiB value, to output writers. Output file counts may change when this differs from the previously inherited writer limit. ### Check List (For Author) - Test: Unit Test. FE build, final Checkstyle, all 154 SPI tests, 53 connector tests and 12 rewrite-driver tests passed locally. Task-session verification is in progress at commit time; SQL rewrite and BE file-distribution tests have not run locally. - Behavior changed: Yes, rewrite writers use the procedure's effective target without modifying the caller's session. - Does this need documentation: No, restore documented behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Iceberg
rewrite_data_filesselects and groups input files, then runs an INSERT-SELECT for each group under one shared rewrite transaction. Each task clones the caller's session, and the backend writer reads its rollover target from the task's query options.What problem does this PR solve?
Issue Number: None
Related PR: #64304 (introduced the regression), #56413 (original implementation)
PR Type: Bugfix
Problem Summary:
The procedure's
target-file-size-bytesreaches file selection but is lost before the output write. For example, a 128 MiB procedure target with the default session value still uses the backend's 1 GiB writer fallback. Carry the connector-resolved value, including the 512 MiB action default, with every rewrite group and apply it only to that task's cloned session before planning the write.Details
branch-4.2at1bb4a49bddc8a505003d2067cc56f0dc3432f23falready passes the action target through its legacy executor and sets it on the task session, so this fix needs no 4.2 backport. No Thrift field or BE implementation changes are needed.Testing
./build.sh --fe -j4: passed locally, including FE packaging, Checkstyle and connector architecture gates.run-fe-ut.sh: all 154 SPI tests, 53 related connector tests, 12 rewrite-driver tests and 7 rewrite-task tests passed locally (226 cases across 42 classes). Both SPI surface checks passed.134217728expected,0observed. After restoring the committed implementation, all seven task tests passed again.The tests check the actual
SessionVariable.toThrift()field and its presence bit, default and explicit values, multiple groups, values above the 32-bit range, immutable settings, invalid input and concurrent task-session isolation. Physical output-file distributions and end-to-end SQL rewrite have not been measured locally; file sizes remain approximate rollover targets.Release note
Iceberg
rewrite_data_filesnow appliestarget-file-size-bytes, including its default 512 MiB value, to output writers. Output file counts may change when the effective target differs from the previously inherited session limit or backend fallback.Check List (For Author)
AI Disclosure