lokeshj1703 commented on code in PR #12290:
URL: https://github.com/apache/hudi/pull/12290#discussion_r1852123878


##########
hudi-common/src/main/java/org/apache/hudi/metadata/BaseTableMetadata.java:
##########
@@ -184,10 +184,10 @@ public Option<BloomFilter> getBloomFilter(final String 
partitionName, final Stri
   }
 
   @Override
-  public Map<Pair<String, String>, BloomFilter> getBloomFilters(final 
List<Pair<String, String>> partitionNameFileNameList)
+  public Map<Pair<String, String>, BloomFilter> getBloomFilters(final 
List<Pair<String, String>> partitionNameFileNameList, final String 
metadataPartitionName)
       throws HoodieMetadataException {
-    if 
(!dataMetaClient.getTableConfig().isMetadataPartitionAvailable(MetadataPartitionType.BLOOM_FILTERS))
 {
-      LOG.error("Metadata bloom filter index is disabled!");
+    if 
(!dataMetaClient.getTableConfig().getMetadataPartitions().contains(metadataPartitionName))
 {
+      LOG.error("Metadata partition not found {}", metadataPartitionName);

Review Comment:
   Addressed



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/FunctionalIndexSupport.scala:
##########
@@ -59,10 +59,20 @@ class FunctionalIndexSupport(spark: SparkSession,
                                         ): Option[Set[String]] = {
     lazy val functionalIndexPartitionOpt = 
getFunctionalIndexPartition(queryFilters)
     if (isIndexAvailable && queryFilters.nonEmpty && 
functionalIndexPartitionOpt.nonEmpty) {
-      val readInMemory = shouldReadInMemory(fileIndex, queryReferencedColumns, 
inMemoryProjectionThreshold)
-      val (prunedPartitions, prunedFileNames) = 
getPrunedPartitionsAndFileNames(prunedPartitionsAndFileSlices)
-      val indexDf = 
loadFunctionalIndexDataFrame(functionalIndexPartitionOpt.get, prunedPartitions, 
readInMemory)
-      Some(getCandidateFiles(indexDf, queryFilters, prunedFileNames))
+      val indexPartition = functionalIndexPartitionOpt.get
+      val indexDefinition = 
metaClient.getIndexMetadata.get().getIndexDefinitions.get(indexPartition)
+      if 
(indexDefinition.getIndexType.equals(HoodieTableMetadataUtil.PARTITION_NAME_COLUMN_STATS))
 {
+        val readInMemory = shouldReadInMemory(fileIndex, 
queryReferencedColumns, inMemoryProjectionThreshold)
+        val (prunedPartitions, prunedFileNames) = 
getPrunedPartitionsAndFileNames(prunedPartitionsAndFileSlices)
+        val indexDf = loadFunctionalIndexDataFrame(indexPartition, 
prunedPartitions, readInMemory)
+        Some(getCandidateFiles(indexDf, queryFilters, prunedFileNames))
+      } else if 
(indexDefinition.getIndexType.equals(HoodieTableMetadataUtil.PARTITION_NAME_BLOOM_FILTERS))
 {
+        val prunedPartitionAndFileNames = 
getPrunedPartitionsAndFileNamesMap(prunedPartitionsAndFileSlices, 
includeLogFiles = true)
+        // TODO: we should get the list of keys to pass from queryFilters

Review Comment:
   Addressed



-- 
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]

Reply via email to