nsivabalan commented on code in PR #7489:
URL: https://github.com/apache/hudi/pull/7489#discussion_r1051329950


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieFileIndex.scala:
##########
@@ -291,21 +292,18 @@ object HoodieFileIndex extends Logging {
     schema.fieldNames.filter { colName => refs.exists(r => 
resolver.apply(colName, r.name)) }
   }
 
-  private def isFilesPartitionAvailable(metaClient: HoodieTableMetaClient): 
Boolean = {
-    
metaClient.getTableConfig.getMetadataPartitions.contains(HoodieTableMetadataUtil.PARTITION_NAME_FILES)
-  }
-
-  def getConfigProperties(spark: SparkSession, options: Map[String, String], 
metaClient: HoodieTableMetaClient) = {
+  def getConfigProperties(spark: SparkSession, options: Map[String, String]) = 
{
     val sqlConf: SQLConf = spark.sessionState.conf
     val properties = new TypedProperties()
+    properties.putAll(options.filter(p => p._2 != null).asJava)
 
     // To support metadata listing via Spark SQL we allow users to pass the 
config via SQL Conf in spark session. Users
     // would be able to run SET hoodie.metadata.enable=true in the spark sql 
session to enable metadata listing.
-    val isMetadataFilesPartitionAvailable = 
isFilesPartitionAvailable(metaClient) &&
-      HoodieSparkConfUtils.getBooleanConfigValue(
-        options, sqlConf, HoodieMetadataConfig.ENABLE.key(), 
HoodieMetadataConfig.DEFAULT_METADATA_ENABLE_FOR_READERS)
-    properties.putAll(options.filter(p => p._2 != null).asJava)
-    properties.setProperty(HoodieMetadataConfig.ENABLE.key(), 
String.valueOf(isMetadataFilesPartitionAvailable))
+    val isMetadataTableEnabled = getConfigValue(options, sqlConf, 
HoodieMetadataConfig.ENABLE.key, null)

Review Comment:
   shouldn't we be passing the default value as last arg (default value for 
readers) ? 



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to