codope commented on issue #3280:
URL: https://github.com/apache/hudi/issues/3280#issuecomment-892762965


   @liujinhui1994 I tried to reproduce this locally but for me the streaming 
ran fine. My setup is Spark 2.4.7, Hadoop 2.7.3 and Hive 2.3.7. I tried for 
both COW and MOR table
   ```
   val query = df.writeStream.queryName("demo").foreachBatch { (batchDF: 
DataFrame, _: Long) => {
           batchDF.persist()
   
           batchDF.write.format("org.apache.hudi")
             .option(TABLE_TYPE_OPT_KEY.key, "COPY_ON_WRITE")
             .option(PRECOMBINE_FIELD_OPT_KEY.key, "kafka_timestamp")
             .option(RECORDKEY_FIELD_OPT_KEY.key, "kafka_partition_offset")
             .option(PARTITIONPATH_FIELD_OPT_KEY.key, "partition_date")
             .option(TABLE_NAME_OPT_KEY.key, "copy_on_write_table")
             .option("hoodie.table.name", "copy_on_write_table")
             .option(HIVE_SYNC_ENABLED_OPT_KEY.key, true)
             .option(HIVE_STYLE_PARTITIONING_OPT_KEY.key, true)
             .mode(SaveMode.Append)
             .save("/tmp/sparkHudi/COPY_ON_WRITE")
   
           batchDF.write.format("org.apache.hudi")
             .option(TABLE_TYPE_OPT_KEY.key, "MERGE_ON_READ")
             .option(TABLE_TYPE_OPT_KEY.key, "COPY_ON_WRITE")
             .option(PRECOMBINE_FIELD_OPT_KEY.key, "kafka_timestamp")
             .option(RECORDKEY_FIELD_OPT_KEY.key, "kafka_partition_offset")
             .option(PARTITIONPATH_FIELD_OPT_KEY.key, "partition_date")
             .option(TABLE_NAME_OPT_KEY.key, "merge_on_read_table")
             .option("hoodie.table.name", "merge_on_read_table")
             .option(HIVE_SYNC_ENABLED_OPT_KEY.key, true)
             .option(HIVE_STYLE_PARTITIONING_OPT_KEY.key, true)
             .mode(SaveMode.Append)
             .save("/tmp/sparkHudi/MERGE_ON_READ")
   
           batchDF.unpersist()
         }}.option("checkpointLocation", "/tmp/sparkHudi/checkpoint/").start()
   ```
   
   Could you try again with the latest master?


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


Reply via email to