AnweshaSen opened a new issue #2347:
URL: https://github.com/apache/hudi/issues/2347
I am using the following csv:
+---+-----+
|age| Name|
+---+-----+
| 10| Ajay|
| 20|Bijay|
| 30|Ram|
| 40|Shyam|
| 50| Mina|
+---+-----+
After loading the csv into a dataFrame I am trying to upsert it with "age"
as "RECORDKEY" and "Name" as "PRECOMBINE" key. The UPSERT method looks like:
Df.write
.format("hudi")
.option(DataSourceWriteOptions.TABLE_TYPE_OPT_KEY,
DataSourceWriteOptions.COW_TABLE_TYPE_OPT_VAL)
.option(DataSourceWriteOptions.RECORDKEY_FIELD_OPT_KEY, "age")
.option(DataSourceWriteOptions.PRECOMBINE_FIELD_OPT_KEY, "Name")
.option(HoodieWriteConfig.TABLE_NAME, tableName)
.option(DataSourceWriteOptions.OPERATION_OPT_KEY,
DataSourceWriteOptions.UPSERT_OPERATION_OPT_VAL)
.option("hoodie.upsert.shuffle.parallelism", "2")
.mode(SaveMode.Append)
.save(s"$basePath/$tableName/")
It gives me the error:
org.apache.avro.SchemaParseException: Illegal initial character: 10
at org.apache.avro.Schema.validateName(Schema.java:1147)
at org.apache.avro.Schema.access$200(Schema.java:81)
at org.apache.avro.Schema$Field.<init>(Schema.java:403)
at
org.apache.avro.SchemaBuilder$FieldBuilder.completeField(SchemaBuilder.java:2124)
at
org.apache.avro.SchemaBuilder$FieldBuilder.completeField(SchemaBuilder.java:2120)
at
org.apache.avro.SchemaBuilder$FieldBuilder.access$5200(SchemaBuilder.java:2034)
at
org.apache.avro.SchemaBuilder$GenericDefault.noDefault(SchemaBuilder.java:2417)
at
org.apache.hudi.spark.org.apache.spark.sql.avro.SchemaConverters$$anonfun$5.apply(SchemaConverters.scala:177)
at
org.apache.hudi.spark.org.apache.spark.sql.avro.SchemaConverters$$anonfun$5.apply(SchemaConverters.scala:174)
......
......
......
How to solve this issue?
----------------------------------------------------------------
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]