Repository navigation
refactor(manifest)!: remove deprecated block size builder setter - #2325
Conversation
Remove the public setter for a field deprecated by the Iceberg spec. Preserve legacy v1 manifest decoding and projection coverage. Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
8badd5d to
bc87cd0
Compare
badalprasadsingh
left a comment
There was a problem hiding this comment.
Close to approval, but there are 2 things which definitely needs a look at.
|
|
||
| ### Unreleased compatibility notes | ||
|
|
||
| - **Deprecated data-file block-size setter removed.** `DataFileBuilder.BlockSizeInBytes` is no longer available. Reading the legacy block-size field from v1 manifests is unchanged. |
There was a problem hiding this comment.
Please add it back.
| } | ||
|
|
||
| // dataFile retains deprecated block_size_in_bytes for reading legacy v1 | ||
| // manifests. New builders leave it at the required default; v2/v3 omit it. |
There was a problem hiding this comment.
Don't the builders leave this at 0, causing v1 manifests to store 0? If so, this comment is incorrect.
As far as I checked last, Java writes 64 MiB, and our v1 schema declares the same default. Could you add omitzero to the tag so v1 writes that default? Also, TestManifestEntryProjectionWhitelistCoversDataFileSchema reads the raw tag, so it needs strings.Cut(name, ",").
BlockSizeInBytes int64 `avro:"block_size_in_bytes,omitzero"`There was a problem hiding this comment.
nit: Please move the doc comment above dataFile onto BlockSizeInBytes field, check how DistinctCounts is written.
| 128, | ||
| ) | ||
| require.NoError(t, err) | ||
| assert.Zero(t, builder.Build().(*dataFile).BlockSizeInBytes) |
There was a problem hiding this comment.
nit: This line checks a field in memory, not something that gets written to the manifest. Same check running in all 5 cases, and calls Build() before the builder is done.
better to remove it.
If you take the omitzero suggestion, test this instead: write a v1 file without setting the field, then check that it reads back as 64mib.
|
+1 to @badalprasadsingh's review. I checked both main points with a throwaway test. Building a data file without the setter and round-tripping a v1 manifest reads back |
zeroshade
left a comment
There was a problem hiding this comment.
Thanks, this takes all of @badalprasadsingh's points: omitzero makes unset v1 block sizes write the 64 MiB schema default, the doc moved onto the field, the whitelist test strips tag options, and the round-trip test pins the default (it fails if omitzero is removed). I pushed a merge of main (bd1e323) that keeps both releases.md notes. go vet ./... (including -tags integration) and go test . pass. LGTM. @badalprasadsingh, could you take another look?
…eam-20261024 Keep both releases.md notes.
zeroshade
left a comment
There was a problem hiding this comment.
Thanks, this takes all of @badalprasadsingh's points: omitzero makes unset v1 block sizes write the 64 MiB schema default, the doc moved onto the field, the whitelist test strips tag options, and the round-trip test pins the default (it fails if omitzero is removed). I pushed a merge of main (f6b6d31) that keeps both releases.md notes. go vet ./... (including -tags integration) and go test . pass. LGTM.
badalprasadsingh
left a comment
There was a problem hiding this comment.
lgtm :) all my points are addressed, thanks.
What
DataFileBuilder.BlockSizeInBytes.Why
Implementation
Refs #2062.