in xtable-core/src/main/java/org/apache/xtable/hudi/HudiConversionTarget.java [581:614]
private HoodieWriteConfig getWriteConfig(
Schema schema,
int numCommitsToKeep,
int maxNumDeltaCommitsBeforeCompaction,
int timelineRetentionInHours) {
Properties properties = new Properties();
properties.setProperty(HoodieMetadataConfig.AUTO_INITIALIZE.key(), "false");
return HoodieWriteConfig.newBuilder()
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(INMEMORY).build())
.withPath(metaClient.getBasePathV2().toString())
.withPopulateMetaFields(metaClient.getTableConfig().populateMetaFields())
.withEmbeddedTimelineServerEnabled(false)
.withSchema(schema == null ? "" : schema.toString())
.withArchivalConfig(
HoodieArchivalConfig.newBuilder()
.archiveCommitsWith(
Math.max(0, numCommitsToKeep - 1), Math.max(1, numCommitsToKeep))
.withAutoArchive(false)
.build())
.withCleanConfig(
HoodieCleanConfig.newBuilder()
.withCleanerPolicy(HoodieCleaningPolicy.KEEP_LATEST_BY_HOURS)
.cleanerNumHoursRetained(timelineRetentionInHours)
.withAutoClean(false)
.build())
.withMetadataConfig(
HoodieMetadataConfig.newBuilder()
.enable(true)
.withProperties(properties)
.withMetadataIndexColumnStats(true)
.withMaxNumDeltaCommitsBeforeCompaction(maxNumDeltaCommitsBeforeCompaction)
.build())
.build();
}