Skip to content

Core, OpenAPI: Preserve avg value sizes in REST JSON - #17855

Draft
huan233usc wants to merge 7 commits into
apache:mainfrom
huan233usc:content-file-parser-avg-value-sizes
Draft

Core, OpenAPI: Preserve avg value sizes in REST JSON#17855
huan233usc wants to merge 7 commits into
apache:mainfrom
huan233usc:content-file-parser-avg-value-sizes

Conversation

@huan233usc

@huan233usc huan233usc commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #17451. Average value sizes were dropped when content files crossed the planned REST scan JSON boundary.

Preserve avg-value-sizes for both data and delete files in ContentFileParser JSON round trips, and document the optional field in the REST OpenAPI schema.

Test plan

  • ./gradlew :iceberg-core:test --tests org.apache.iceberg.TestContentFileParser --tests org.apache.iceberg.TestFileScanTaskParser --tests org.apache.iceberg.TestDataTaskParser
  • ./gradlew :iceberg-core:spotlessCheck

AI Disclosure

Keep average value sizes in REST content-file JSON round trips and drop stale path-size statistics when rewrite_table_path rewrites position deletes.

Generated-by: Cursor
Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +5126 to +5143
IntegerMap:
type: object
properties:
keys:
type: array
items:
$ref: '#/components/schemas/IntegerTypeValue'
description: "List of integer column ids for each corresponding value"
values:
type: array
items:
$ref: '#/components/schemas/IntegerTypeValue'
description: "List of integer values, matched to 'keys' by index"
example:
{
"keys": [ 1, 2 ],
"values": [ 8, 16 ]
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we use ValueMap ? like what we use for other stats

Comment thread open-api/rest-catalog-open-api.yaml Outdated
Comment on lines +5244 to +5249
avg-value-sizes:
allOf:
- $ref: '#/components/schemas/IntegerMap'
description:
Map of column id to average value size in memory (uncompressed) in
bytes over non-null values

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be part of data file ? like lower / upper bound are ?

@singhpk234
singhpk234 requested a review from nastra August 28, 2026 05:25
@huan233usc huan233usc changed the title Core, OpenAPI: Preserve avg value sizes across rewrites [WIP]Core, OpenAPI: Preserve avg value sizes across rewrites Aug 28, 2026
Leave REST JSON round-trip changes here; rewrite_table_path handling moves to a separate PR.

Generated-by: Cursor
@huan233usc huan233usc changed the title [WIP]Core, OpenAPI: Preserve avg value sizes across rewrites Core, OpenAPI: Preserve avg value sizes in REST JSON Aug 28, 2026
@huan233usc
huan233usc marked this pull request as draft August 28, 2026 05:45
@huan233usc

Copy link
Copy Markdown
Contributor Author

Hi @singhpk234 for quick review -- I just realize that this PR was not marked as draft when I am double checking the generated code vs spec. Will asked for another review when I finish my self validation. Sry for confusion

Xin Huang added 5 commits August 27, 2026 22:53
avg_value_size_in_bytes lives in v4 content_stats field structs, not a v1-v3 metrics map. REST JSON now uses content-stats keyed by field ID.

Generated-by: Cursor
Use the spec wording for content_stats and avg_value_size_in_bytes.

Generated-by: Cursor
Match other optional ContentFileParser fields: explicit JSON null is missing, and invalid field IDs get a contextual error.

Generated-by: Cursor
Satisfy checkstyle by creating the parsed content stats map with the relocated Maps utility.

Generated-by: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants