jonvex commented on PR #7179:
URL: https://github.com/apache/hudi/pull/7179#issuecomment-1317221904
`def compareUpdateDfWithHudiDf(inputDf: Dataset[Row], hudiDf: Dataset[Row],
beforeDf: Dataset[Row], colsToCompare: String ) : Unit = {
val hudiWithoutMeta =
hudiDf.drop(HoodieRecord.RECORD_KEY_METADATA_FIELD,
HoodieRecord.PARTITION_PATH_METADATA_FIELD,
HoodieRecord.COMMIT_SEQNO_METADATA_FIELD,
HoodieRecord.COMMIT_TIME_METADATA_FIELD, HoodieRecord.FILENAME_METADATA_FIELD)
hudiWithoutMeta.registerTempTable("hudiTbl")
inputDf.registerTempTable("inputTbl")
beforeDf.registerTempTable("beforeTbl")
val hudiDfToCompare = spark.sqlContext.sql("select " + colsToCompare + "
from hudiTbl")
val inputDfToCompare = spark.sqlContext.sql("select " + colsToCompare +
" from inputTbl")
val beforeDfToCompare = spark.sqlContext.sql("select " + colsToCompare +
" from beforeTbl")
assertEquals(hudiDfToCompare.intersect(inputDfToCompare).count,
inputDfToCompare.count)
assertEquals(hudiDfToCompare.except(inputDfToCompare).except(beforeDfToCompare).count,
0)
}`
--
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]