nsivabalan commented on issue #3879:
URL: https://github.com/apache/hudi/issues/3879#issuecomment-1032016379


   I could not reproduce the missing records. 
   
   ```
   val df = 
spark.read.option("encoding","utf-8").option("header","true").option("inferSchema","true").option("delimiter",";").format("com.databricks.spark.csv").load("/Users/nsb/Downloads/anonymous_sample_table/")
   
   df.count
   res0: Long = 10000
   
   import org.apache.hudi.QuickstartUtils._
   import scala.collection.JavaConversions._
   import org.apache.spark.sql.SaveMode._
   import org.apache.hudi.DataSourceReadOptions._
   import org.apache.hudi.DataSourceWriteOptions._
   import org.apache.hudi.config.HoodieWriteConfig._
   
   val tableName = "hudi_trips_cow"
   val basePath = "/tmp/hudi_trips_cow5"
   
   // upsert operation
   
   
   df.write.format("hudi").
     options(getQuickstartWriteConfigs).
     option(PRECOMBINE_FIELD_OPT_KEY, "SORT_KEY").
     option(RECORDKEY_FIELD_OPT_KEY, "UUID").
     option(PARTITIONPATH_FIELD_OPT_KEY, "PARTITION").
     option(TABLE_NAME, tableName).
     mode(Append).save(basePath)
   
   
   val hudiDf = spark.read.format("hudi").load(basePath)
   hudiDf.count
   res4: Long = 10000
   
   
   // bulk insert operation
   
   val basePath = "/tmp/hudi_trips_cow6"
   
   df.write.format("hudi").
     options(getQuickstartWriteConfigs).
     option(PRECOMBINE_FIELD_OPT_KEY, "SORT_KEY").
     option("hoodie.datasource.write.operation","bulk_insert").
     option(RECORDKEY_FIELD_OPT_KEY, "UUID").
     option(PARTITIONPATH_FIELD_OPT_KEY, "PARTITION").
     option(TABLE_NAME, tableName).
     mode(Append).save(basePath)
   
   val hudiDf = spark.read.format("hudi").load(basePath)
   hudiDf.count
   ```


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