Skip to content

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented May 14, 2025

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#6078

What's changed and what's your intention?

This PR adds helpers for the plain format:

  • PlainWriteFormat
    • Processes record batches to write
  • PlainReadFormat
    • Gets statistics
    • Adds internal columns to read
    • SST level projection handling

The PlainWriteFormat is quite simple as it only overrides sequences on demand.

The PlainReadFormat is similar to PrimaryKeyReadFormat. Since there is no primary key encoding, the read format can get the min/max value for each column.

It renames the old helpers to PrimaryKeyWriteFormat and PrimaryKeyReadFormat. The ReadFormat now is an enum that wraps the two different formats.

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label May 14, 2025
Comment on lines +237 to +244
/// Returns min/max values of specific columns.
/// Returns None if the column does not have statistics.
/// The column should not be encoded as a part of a primary key.
pub(crate) fn column_values(
row_groups: &[impl Borrow<RowGroupMetaData>],
column: &ColumnMetadata,
column_index: usize,
is_min: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just move the implementation of column_values() and column_null_counts() to this place.

@evenyag evenyag marked this pull request as ready for review May 14, 2025 05:02
@evenyag evenyag requested review from v0y4g3r and waynexia as code owners May 14, 2025 05:02
@evenyag evenyag requested review from WenyXu and discord9 May 15, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant