You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "Alexander Filipchik (Jira)" <ji...@apache.org> on 2020/04/14 19:35:00 UTC
[jira] [Updated] (HUDI-793) Avro schema for metadata fields is
incorrect (no defaults). Defaults handling is broken
[ https://issues.apache.org/jira/browse/HUDI-793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexander Filipchik updated HUDI-793:
-------------------------------------
Summary: Avro schema for metadata fields is incorrect (no defaults). Defaults handling is broken (was: Avro schema for metadata fields is incorrect (no defaults). Default's handling is broken)
> Avro schema for metadata fields is incorrect (no defaults). Defaults handling is broken
> ---------------------------------------------------------------------------------------
>
> Key: HUDI-793
> URL: https://issues.apache.org/jira/browse/HUDI-793
> Project: Apache Hudi (incubating)
> Issue Type: Bug
> Reporter: Alexander Filipchik
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> HoodieAvroUtils adds hudi related fields to Avros:
> {code:java}
> // Schema.Field commitTimeField =
> new Schema.Field(HoodieRecord.COMMIT_TIME_METADATA_FIELD, METADATA_FIELD_SCHEMA, "", (Object) null)
> {code}
> It generates:
> {code:java}
> // "fields": [
> {
> "name": "_hoodie_commit_time",
> "type": [
> "null",
> "string"
> ],
> "doc": ""
> }
> {code}
> and it should generate:
> {code:java}
> // "fields": [
> {
> "name": "_hoodie_commit_time",
> "type": [
> "null",
> "string"
> ],
> "doc": "",
> "default": null
> }
> {code}
> "default": null is missing
>
> Also, when incoming schema has "default": null, HoodieAvroUtils.rewrite breaks as it can't properly copy null value
--
This message was sent by Atlassian Jira
(v8.3.4#803005)