michael1991 commented on issue #10609:
URL: https://github.com/apache/hudi/issues/10609#issuecomment-2155893143
Hi @ad1happy2go , I can reproduce this error by following env and scala
code, hope it could be helpful.
Environment: Dataproc 2.1(Spark 3.3.2) with Hudi 0.14.x / Dataproc 2.2(Spark
3.5.0) with Hudi 0.15.x
Scala code in `spark-shell`:
```scala
import org.apache.spark.sql._
import spark.implicits._
val path = "gs://bucket/test/hudi-test"
val data = Seq((1, "Alice", 29),(2, "Bob", 35),(3, "Catherine",
23)).toDF("id", "name", "age")
val config = Map(
"hoodie.table.name" -> "hudi-test",
"hoodie.metadata.enable" -> "true",
"hoodie.datasource.write.table.type" -> "COPY_ON_WRITE",
"hoodie.datasource.write.payload.class" ->
"org.apache.hudi.common.model.PartialUpdateAvroPayload",
"hoodie.datasource.write.recordkey.field" -> "id",
"hoodie.datasource.write.reconcile.schema" -> "true",
"hoodie.datasource.write.new.columns.nullable" -> "true",
"hoodie.combine.before.insert" -> "false",
"hoodie.combine.before.upsert" -> "false",
"hoodie.cleaner.commits.retained" -> "6",
"hoodie.parquet.compression.codec" -> "snappy"
)
data.write.format("hudi").options(config).option("hoodie.datasource.write.operation",
"insert").mode(SaveMode.Append).save(path)
spark.read.format("hudi").option("hoodie.metadata.enable",
"true").load(path).show(10,false)
val upsertData = Seq((1, 30)).toDF("id","age")
upsertData.write.format("hudi").options(config).option("hoodie.datasource.write.operation",
"upsert").mode(SaveMode.Append).save(path)
```
Try if possible and let me know if you can reproduce this error. Thanks in
advance!
--
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]