You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/11/16 15:42:36 UTC
[GitHub] [hudi] jonvex commented on pull request #7179: [HUDI-5193] Enhancing spark-ds write tests for some of the core user flows
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org