jjtjiang commented on issue #8981:
URL: https://github.com/apache/hudi/issues/8981#issuecomment-1592678623
> Referenc
The possible cause is that some hudi0.10.2 data is residual in hive
metadata. I used the same table name earlier on hudi-0.10, but I have removed
the table.
the code is as below:
val optionStr =
"""
|{
|
"hoodie.metadata.enable": "false",
|
"hoodie.datasource.compaction.async.enable": "true",
|
"hoodie.compact.inline": "true",
|
"hoodie.clean.automatic": "true",
|
"hoodie.clean.async": "false",
|
"hoodie.cleaner.commits.retained": "40",
|
"hoodie.archive.automatic": "true",
|
"hoodie.archive.async": "false",
|
"hoodie.keep.max.commits": "50",
|
"hoodie.keep.min.commits": "45",
|
"hoodie.datasource.hive_sync.support_timestamp": "false",
|
"hoodie.datasource.write.hive_style_partitioning": "true",
|
"hoodie.datasource.hive_sync.mode": "HMS",
|
"hoodie.finalize.write.parallelism": "6"
| }
|""".stripMargin
val options = JSON.parseObject(optionStr, classOf[java.util.Map[String,
String]]).asScala
upsertDs.toDF().write.format(hudiOrgPro)
.option(DataSourceWriteOptions.OPERATION.key(),
DataSourceWriteOptions.UPSERT_OPERATION_OPT_VAL)
.option(DataSourceWriteOptions.PARTITIONPATH_FIELD.key(), "")
.option(DataSourceWriteOptions.KEYGENERATOR_CLASS_NAME.key(),
classOf[NonpartitionedKeyGenerator].getName)
.option(DataSourceWriteOptions.HIVE_PARTITION_FIELDS.key(), "")
.option(DataSourceWriteOptions.HIVE_PARTITION_EXTRACTOR_CLASS.key(),
classOf[NonPartitionedExtractor].getName)
.option(DataSourceWriteOptions.STREAMING_IGNORE_FAILED_BATCH.key(),
"false")
.option(DataSourceWriteOptions.TABLE_TYPE.key(), "")
.option(HoodieWriteConfig.TBL_NAME.key(), "MERGE_ON_READ")
.option(DataSourceWriteOptions.RECORDKEY_FIELD.key(),
"invoice_no,invoice_type,proj_no")
.option(DataSourceWriteOptions.PRECOMBINE_FIELD.key(),
"invoice_no,invoice_type,proj_no")
.option(DataSourceWriteOptions.HIVE_SYNC_ENABLED.key(), "true")
.option(DataSourceWriteOptions.HIVE_DATABASE.key(), "ods_ca")
.option(DataSourceWriteOptions.HIVE_TABLE.key(),
"ods_ec_p1ec_refund_ec_hudi")
.option(HoodieWriteConfig.INSERT_PARALLELISM_VALUE.key, "30")
.option(HoodieWriteConfig.BULKINSERT_PARALLELISM_VALUE.key, "30")
.option(HoodieWriteConfig.UPSERT_PARALLELISM_VALUE.key, "30")
.option(HoodieWriteConfig.DELETE_PARALLELISM_VALUE.key, "30")
.option(HoodieIndexConfig.INDEX_TYPE.key(),
HoodieIndex.IndexType.BLOOM.name())
.option(HoodieIndexConfig.BLOOM_INDEX_UPDATE_PARTITION_PATH_ENABLE.key(),
"true")
.option(DataSourceWriteOptions.HIVE_SKIP_RO_SUFFIX_FOR_READ_OPTIMIZED_TABLE.key(),
value = true)
//merge compaction
.option(HoodieMemoryConfig.MAX_MEMORY_FRACTION_FOR_MERGE.key(), "0.8")
.option(HoodieMemoryConfig.MAX_MEMORY_FRACTION_FOR_COMPACTION.key(),
"0.8")
//metadata config
.option(HoodieMetadataConfig.COMPACT_NUM_DELTA_COMMITS.key(), "50")
//compaction
.option(HoodieCompactionConfig.INLINE_COMPACT_NUM_DELTA_COMMITS.key(),
"5")
.option(HoodieStorageConfig.PARQUET_OUTPUT_TIMESTAMP_TYPE.key(),
"TIMESTAMP_MICROS")
.options(options)
// .option(DataSourceWriteOptions.HIVE_SYNC_MODE.key(),"hms")
.mode(SaveMode.Append)
.save(path)
--
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]