rahil-c commented on code in PR #17573:
URL: https://github.com/apache/hudi/pull/17573#discussion_r2624786447
##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/avro/HoodieSparkSchemaConverters.scala:
##########
@@ -102,7 +102,14 @@ object HoodieSparkSchemaConverters {
val fields = st.map { f =>
val fieldSchema = toHoodieType(f.dataType, f.nullable, f.name,
childNameSpace)
val doc = f.getComment.orNull
- HoodieSchemaField.of(f.name, fieldSchema, doc)
+ // Match existing Avro SchemaConverters behavior: use NULL_VALUE
for nullable unions
+ // to avoid serializing "default":null in JSON representation
+ val defaultVal = if (fieldSchema.isNullable) {
+ HoodieJsonProperties.NULL_VALUE
+ } else {
+ null
+ }
+ HoodieSchemaField.of(f.name, fieldSchema, doc, defaultVal)
}
Review Comment:
Have made a change on that line 190 let me know if it makes sense
--
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]