codope commented on code in PR #11634:
URL: https://github.com/apache/hudi/pull/11634#discussion_r1743787940
##########
hudi-common/src/test/java/org/apache/hudi/metadata/TestMetadataPartitionType.java:
##########
@@ -183,4 +187,40 @@ public void testGetMetadataPartitionRecordType() {
assertEquals(6, MetadataPartitionType.PARTITION_STATS.getRecordType());
assertEquals(7, MetadataPartitionType.SECONDARY_INDEX.getRecordType());
}
+
+ @Test
+ public void testGetFunctionalIndexPath() {
+ MetadataPartitionType partitionType =
MetadataPartitionType.FUNCTIONAL_INDEX;
+ HoodieTableMetaClient metaClient = mock(HoodieTableMetaClient.class);
+ String indexName = "testIndex";
+
+ Map<String, HoodieIndexDefinition> indexDefinitions = new HashMap<>();
+ indexDefinitions.put(
+ indexName,
+ new HoodieIndexDefinition("func_index_testIndex", "column_stats",
"lower", Collections.singletonList("name"), null));
+ HoodieIndexMetadata indexMetadata = new
HoodieIndexMetadata(indexDefinitions);
+ when(metaClient.getIndexMetadata()).thenReturn(Option.of(indexMetadata));
+
+ String result = partitionType.getPartitionPath(metaClient, indexName);
+ assertEquals("func_index_testIndex", result);
+ }
+
+ @Test
+ public void testGetNonFunctionalIndexPath() {
+ MetadataPartitionType partitionType = MetadataPartitionType.COLUMN_STATS;
+ HoodieTableMetaClient metaClient = mock(HoodieTableMetaClient.class);
+
+ String result = partitionType.getPartitionPath(metaClient, null);
+ assertEquals(partitionType.getPartitionPath(), result);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]