bvaradar commented on issue #2067:
URL: https://github.com/apache/hudi/issues/2067#issuecomment-687366557


   0.5.0 is a really old version. I tried with 0.5.3 and this seems to work 
fine:
   `
   ~/spark-2.4.4-bin-hadoop2.7/bin/spark-shell --packages 
org.apache.hudi:hudi-spark-bundle_2.11:0.5.3,org.apache.spark:spark-avro_2.11:2.4.4
   --conf 'spark.serializer=org.apache.spark.serializer.KryoSerializer'
   
   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 basePath = "file:///tmp/hudi_cow_table_new_1"
   
   
   val df  = Seq((1, "a", "b",0)).toDF("col1","col2","col3","time")
   val df1  = Seq((1, "a", "c",1)).toDF("col1","col2","col3","time")
   
   df.write.format("org.apache.hudi").
     option(PRECOMBINE_FIELD_OPT_KEY, "time").
     option(RECORDKEY_FIELD_OPT_KEY, "col1").
     option(PARTITIONPATH_FIELD_OPT_KEY, "col2,col3").
     option(KEYGENERATOR_CLASS_OPT_KEY, 
"org.apache.hudi.keygen.ComplexKeyGenerator").
     option("hoodie.index.type", "GLOBAL_BLOOM").
     option(TABLE_NAME, "TEST_TABLE").
     mode(Overwrite).
     save(basePath)
     
     
   df1.write.format("org.apache.hudi").
     option(PRECOMBINE_FIELD_OPT_KEY, "time").
     option(RECORDKEY_FIELD_OPT_KEY, "col1").
     option(PARTITIONPATH_FIELD_OPT_KEY, "col2,col3").
     option(KEYGENERATOR_CLASS_OPT_KEY, 
"org.apache.hudi.keygen.ComplexKeyGenerator").
     option("hoodie.index.type", "GLOBAL_BLOOM").
     option(TABLE_NAME, "TEST_TABLE").
     mode(Append).
     save(basePath)
     
   `
   
   Can you try with later versions of Hudi.
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to