public static String getPartitionNameFromPartitionType(MetadataPartitionType partitionType, HoodieTableMetaClient metaClient, String indexName) {
    if (MetadataPartitionType.FUNCTIONAL_INDEX.equals(partitionType)) {
      checkArgument(metaClient.getIndexMetadata().isPresent(), "Index definition is not present");
      return metaClient.getIndexMetadata().get().getIndexDefinitions().get(indexName).getIndexName();
    }
    return partitionType.getPartitionPath();
  }
@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 = HoodieIndexUtils.getPartitionNameFromPartitionType(partitionType, metaClient, indexName);
    assertEquals("func_index_testIndex", result);
  }