Repository navigation
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Two inline comments on TTL validation and row-tracked append files.
| checkArgument( | ||
| !SpecialFields.isSystemField(field.id()), "Cannot drop system column stats."); | ||
| checkArgument( | ||
| !name.equals(options.recordLevelTimeField()), |
There was a problem hiding this comment.
Protect the persisted TTL field
This guard uses the options for the current call. On a primary-key table configured with record-level.time-field=event_time, passing options => 'record-level.time-field=ingest_time' and drop_stats_columns => 'event_time' removes the stats for the table's TTL field. A later full compaction with the persisted options can skip max-level files containing expired rows because RecordLevelExpire.isExpireFile returns false when the minimum is missing. Please validate against the target branch's latest persisted TTL field in both the rewrite and the dry run.
There was a problem hiding this comment.
Fixed. Both rewrite and dry run now protect the target branch’s latest persisted TTL field. Added regression tests for option overrides, stale table instances, and branch-specific settings.
| key -> | ||
| schemaLoader | ||
| .apply(key.getLeft()) | ||
| .dataFileSchema(key.getRight()) |
There was a problem hiding this comment.
Resolve row-tracking columns in the physical file schema
On a regular append table with row-tracking.enabled=true, data compaction can produce files whose writeCols include _ROW_ID and _SEQUENCE_NUMBER. Projecting those names from the historical table schema throws ArrayIndexOutOfBoundsException during the stats probe, so compact_manifest fails even when dropping stats for a user column. Please resolve the stats positions against the historical physical file schema, including the stored row-tracking fields.
There was a problem hiding this comment.
Fixed. Stats projection now includes stored row-tracking fields in the historical file schema. Added dense/sparse regression tests covering append compaction and column renaming, verifying retained stats and row-tracking values are preserved.
35756aa to
4942c41
Compare
Purpose
Wide tables can accumulate large column statistics in manifests, making metadata scans such as
$partitionsexpensive. Changing stats-collection settings does not remove existing statistics.Add optional
drop_stats_columnstocompact_manifestfor Flink/Spark and the Flink action. It removes selected value statistics without rewriting data files, using streaming reads/writes and the existing statistics format.Key/partition statistics and historical snapshots/tags are preserved. Default behavior is unchanged; removing statistics may reduce file pruning.
In a local synthetic sample with 8,000 files and 300 STRING stats columns, removing 290 columns reduced current-snapshot manifests from 6.286 MiB to 0.255 MiB (95.9%).
Tests
42 related tests passed, covering append, primary-key, and Data Evolution tables, schema evolution, failure cleanup, and removal beyond the sort rewrite limit. Formatting, license, and repository checks passed.