easonwood commented on issue #8540:
URL: https://github.com/apache/hudi/issues/8540#issuecomment-1522632098
@voonhous
Actually we created a dataframe only containing the primaryKey for this
table. And do DELETE operation by writing it to hudi.
Code is like this :
logger.error(s"Schema for dataToDelete: ${dataToDelete.printSchema()}")
dataToDelete
.write
.format("org.apache.hudi")
.options(hudiOptions)
.option(OPERATION_OPT_KEY, DELETE_OPERATION_OPT_VAL)
.option(PRECOMBINE_FIELD_OPT_KEY, precombineKey)
.option(RECORDKEY_FIELD_OPT_KEY, recordKey)
.option(HIVE_PARTITION_EXTRACTOR_CLASS_OPT_KEY,
classOf[MultiPartKeysValueExtractor].getName)
.option("hoodie.datasource.write.partitionpath.field",
partitionPath)
.option(HoodieWriteConfig.TABLE_NAME, tableName)
.mode(SaveMode.Append)
.save(basePath)
the dataToDelete.printSchema :

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