[HUDI-4250][HUDI-4202] Optimize performance of Column Stats Index reading in Data Skipping (#5746)
We provide an alternative way of fetching Column Stats Index within the reading process to avoid the penalty of a more heavy-weight execution scheduled through a Spark engine.
This commit is contained in:
@@ -1504,7 +1504,7 @@ public class TestHoodieBackedMetadata extends TestHoodieMetadataBase {
|
||||
// prefix search for column (_hoodie_record_key)
|
||||
ColumnIndexID columnIndexID = new ColumnIndexID(HoodieRecord.RECORD_KEY_METADATA_FIELD);
|
||||
List<HoodieRecord<HoodieMetadataPayload>> result = tableMetadata.getRecordsByKeyPrefixes(Collections.singletonList(columnIndexID.asBase64EncodedString()),
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath()).collectAsList();
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath(), true).collectAsList();
|
||||
|
||||
// there are 3 partitions in total and 2 commits. total entries should be 6.
|
||||
assertEquals(result.size(), 6);
|
||||
@@ -1515,7 +1515,7 @@ public class TestHoodieBackedMetadata extends TestHoodieMetadataBase {
|
||||
// prefix search for col(_hoodie_record_key) and first partition. only 2 files should be matched
|
||||
PartitionIndexID partitionIndexID = new PartitionIndexID(HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH);
|
||||
result = tableMetadata.getRecordsByKeyPrefixes(Collections.singletonList(columnIndexID.asBase64EncodedString().concat(partitionIndexID.asBase64EncodedString())),
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath()).collectAsList();
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath(), true).collectAsList();
|
||||
// 1 partition and 2 commits. total entries should be 2.
|
||||
assertEquals(result.size(), 2);
|
||||
result.forEach(entry -> {
|
||||
@@ -1534,7 +1534,7 @@ public class TestHoodieBackedMetadata extends TestHoodieMetadataBase {
|
||||
// prefix search for column {commit time} and first partition
|
||||
columnIndexID = new ColumnIndexID(HoodieRecord.COMMIT_TIME_METADATA_FIELD);
|
||||
result = tableMetadata.getRecordsByKeyPrefixes(Collections.singletonList(columnIndexID.asBase64EncodedString().concat(partitionIndexID.asBase64EncodedString())),
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath()).collectAsList();
|
||||
MetadataPartitionType.COLUMN_STATS.getPartitionPath(), true).collectAsList();
|
||||
|
||||
// 1 partition and 2 commits. total entries should be 2.
|
||||
assertEquals(result.size(), 2);
|
||||
|
||||
Reference in New Issue
Block a user