nsivabalan opened a new pull request #2762:
URL: https://github.com/apache/hudi/pull/2762
## What is the purpose of the pull request
For Union schema types, avro expects "null" to be first entry for null to be
considered as default value. But since Hudi leverages
SchemaConverters.toAvroType(...) org.apache.spark:spark-avro_* library,
structType to avro results in "null" being 2nd entry for UNION type schemas.
Also, there is no default value set in this avro schema thus generated. This
patch fixes this issue.
## Brief change log
- Fixing struct type to avro schema conversion to fix null as first entry in
UNION schema types and add defaults values for the same.
## Verify this pull request
This change added tests and can be verified as follows:
- Added tests to HoodieSparkSqlWriterSuite // This test fails if not for
the fix in source code for MOR table and succeeds w/ the fix.
## Committer checklist
- [ ] Has a corresponding JIRA in PR title & commit
- [ ] Commit message is descriptive of the change
- [ ] CI is green
- [ ] Necessary doc changes done or have another open PR
- [ ] For large changes, please consider breaking it into sub-tasks under
an umbrella JIRA.
--
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]