ad1happy2go commented on issue #10488:
URL: https://github.com/apache/hudi/issues/10488#issuecomment-1887107501
Thanks @Amar1404 for raising this. You are right. reads are failing when
when hoodie.schema.on.read.enable is true. Below is simple. We are facing
exception when both `hoodie.datasource.write.reconcile.schema` and
`hoodie.schema.on.read.enable` are true. When any one is false, it works well.
Reproducible code -
```
columns = ["ts","uuid","rider","driver","fare","city"]
data
=[(1695159649087,"334e26e9-8355-45cc-97c6-c31daf0df330","rider-A","driver-K",19.10,"san_francisco"),
(1695091554788,"e96c4396-3fad-413a-a942-4cb36106d721","rider-C","driver-M",27.70
,"san_francisco"),
(1695046462179,"9909a8b1-2d15-4d3d-8ec9-efc48c536a00","rider-D","driver-L",33.90
,"san_francisco"),
(1695516137016,"e3cf430c-889d-4015-bc98-59bdce1e530c","rider-F","driver-P",34.15,"sao_paulo"),
(1695115999911,"c8abbe79-8d89-47ea-b4ce-4d224bae5bfa","rider-J","driver-T",17.85,"chennai")]
inserts = spark.createDataFrame(data).toDF(*columns)
hudi_options= {
"hoodie.datasource.write.reconcile.schema" : "true",
"hoodie.schema.on.read.enable" : "true",
"hoodie.datasource.write.partitionpath.field" : "city",
'hoodie.datasource.write.recordkey.field': 'uuid',
'hoodie.datasource.write.precombine.field': 'ts',
'hoodie.table.name':'hudi_table'
}
inserts.write.format("hudi"). \
options(**hudi_options). \
mode("overwrite"). \
save(PATH)
print(spark.read.format("hudi").options(**hudi_options).load(PATH).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]