fix(spec): implement Display for BinaryTableStats - #632
Open
u70b3 wants to merge 1 commit into
Open
Conversation
Replace the repository's only todo!() with a labeled summary in the style of DataFileMeta's Display. min/max values are serialized BinaryRows that cannot be decoded without the column types, so they print as raw bytes, matching how DataFileMeta prints minKey/keyStats.
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.
Purpose
Linked issue: close #631
The
Displayimpl forBinaryTableStatsinspec/stats.rsis the repository's onlytodo!()and would panic if any code path ever formats stats throughDisplay(logging, debugging, error messages). This implements it.Brief change log
Implement
DisplayforBinaryTableStatsas a labeled summary, following the convention ofDataFileMeta'sDisplay:min_values/max_valuesare serializedBinaryRows that cannot be decoded without the column types, so they print as raw bytes — the same conventionDataFileMetauses for itsminKey/keyStatsfields.null_countsitems areOption<i64>(None= unknown), which{:?}renders naturally.Assumptions and notes for reviewers
Display:ManifestFileMetaandDataFileMetaprintBinaryTableStatsfields via{:?}(Debug), so this change is preventive — it removes a panic landmine rather than fixing a live crash. The alternative (deleting the unused impl) was considered and rejected:BinaryTableStatsis a public spec-layer type andDisplayis a basic debugging capability, so implementing it is the additive, non-breaking choice.DataFileMetaconvention; a byte-length summary (e.g.minValues=12 bytes) would also work. Happy to switch if reviewers prefer.Tests
spec::stats::tests::display_formats_labeled_fields— exact output for known bytes, includingSome/Nonenull-count mixesspec::stats::tests::display_empty_stats_does_not_panic—BinaryTableStats::empty()boundary casecargo test -p paimon --lib spec::passes (450 tests);cargo fmtandclippyare clean.API and Format
No API or storage format change; this fills in a previously unimplemented trait method.
Documentation
No documentation update needed.
🤖 Generated with Claude Code