Skip to content

Commit

Permalink
[MINOR] Enable metadata on the Spark reader by default
Browse files Browse the repository at this point in the history
  • Loading branch information
codope committed Nov 12, 2024
1 parent cea81e8 commit 4f57e15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import static org.apache.hudi.common.config.HoodieMetadataConfig.DEFAULT_METADATA_ENABLE_FOR_READERS;
import static org.apache.hudi.common.config.HoodieMetadataConfig.ENABLE;
import static org.apache.hudi.common.table.timeline.TimelineUtils.validateTimestampAsOf;

Expand Down Expand Up @@ -147,7 +146,7 @@ public BaseHoodieTableFileIndex(HoodieEngineContext engineContext,

this.metadataConfig = HoodieMetadataConfig.newBuilder()
.fromProperties(configProperties)
.enable(configProperties.getBoolean(ENABLE.key(), DEFAULT_METADATA_ENABLE_FOR_READERS)
.enable(configProperties.getBoolean(ENABLE.key(), ENABLE.defaultValue())
&& HoodieTableMetadataUtil.isFilesPartitionAvailable(metaClient))
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.apache.hudi.HoodieBaseRelation.{convertToAvroSchema, isSchemaEvolutio
import org.apache.hudi.HoodieConversionUtils.toScalaOption
import org.apache.hudi.HoodieFileIndex.getConfigProperties
import org.apache.hudi.common.config.{ConfigProperty, HoodieMetadataConfig, HoodieReaderConfig, TypedProperties}
import org.apache.hudi.common.config.HoodieMetadataConfig.{DEFAULT_METADATA_ENABLE_FOR_READERS, ENABLE}
import org.apache.hudi.common.config.HoodieMetadataConfig.ENABLE
import org.apache.hudi.common.model.HoodieRecord
import org.apache.hudi.common.table.{HoodieTableConfig, HoodieTableMetaClient, TableSchemaResolver}
import org.apache.hudi.common.table.timeline.HoodieTimeline
Expand Down Expand Up @@ -241,7 +241,7 @@ class HoodieMergeOnReadSnapshotHadoopFsRelationFactory(override val sqlContext:
val configProperties: TypedProperties = getConfigProperties(sparkSession, options, metaClient.getTableConfig)
val metadataConfig: HoodieMetadataConfig = HoodieMetadataConfig.newBuilder
.fromProperties(configProperties)
.enable(configProperties.getBoolean(ENABLE.key, DEFAULT_METADATA_ENABLE_FOR_READERS)
.enable(configProperties.getBoolean(ENABLE.key, ENABLE.defaultValue())
&& HoodieTableMetadataUtil.isFilesPartitionAvailable(metaClient)).build

val tableState: HoodieTableState = // Subset of the state of table's configuration as of at the time of the query
Expand Down

0 comments on commit 4f57e15

Please sign in to comment.