Skip to content

Conversation

@yihua
Copy link
Contributor

@yihua yihua commented Feb 23, 2022

What is the purpose of the pull request

This PR fixes the problem of incorrect value and null count read from column stats in metadata table. The root cause is the wrong order of arguments passed to the constructor of HoodieMetadataColumnStats. The constructor is:

  public HoodieMetadataColumnStats(java.lang.String fileName, java.lang.String minValue, java.lang.String maxValue, java.lang.Long valueCount, java.lang.Long nullCount, java.lang.Long totalSize, java.lang.Long totalUncompressedSize, java.lang.Boolean isDeleted) {

and the original init is

columnStatMetadata = new HoodieMetadataColumnStats(
            (String) v.get(COLUMN_STATS_FIELD_RESOURCE_NAME),
            (String) v.get(COLUMN_STATS_FIELD_MIN_VALUE),
            (String) v.get(COLUMN_STATS_FIELD_MAX_VALUE),
            (Long) v.get(COLUMN_STATS_FIELD_NULL_COUNT),
            (Long) v.get(COLUMN_STATS_FIELD_VALUE_COUNT),
            (Long) v.get(COLUMN_STATS_FIELD_TOTAL_SIZE),
            (Long) v.get(COLUMN_STATS_FIELD_TOTAL_UNCOMPRESSED_SIZE),
            (Boolean) v.get(COLUMN_STATS_FIELD_IS_DELETED)
        );

The actual values of valueCount and nullCount passed in are switched.

(Below screenshot shows the diff of column stats from validation: left: from metadata table, right: from base files (ground truth))

Screen Shot 2022-02-22 at 16 07 32

Brief change log

  • Uses builder of HoodieMetadataColumnStats in HoodieMetadataPayload to set each field explicitly.

Verify this pull request

Runs Hudi Deltastreamer continuous mode writing MOR table, async compaction, cleaner, all multi-modal indexing enabled and verifies that after the fix, the column stats from metadata table is correct compared to the ground truth from base files.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@apache apache deleted a comment from hudi-bot Feb 23, 2022
@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@codope codope self-assigned this Feb 23, 2022
@codope codope merged commit 4e8accc into apache:master Feb 23, 2022
vingov pushed a commit to vingov/hudi that referenced this pull request Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants