You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "leesf (Jira)" <ji...@apache.org> on 2020/05/16 09:27:00 UTC

[jira] [Resolved] (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 ]

leesf resolved HUDI-793.
------------------------
    Resolution: Fixed

Fixed via master: 83796b3189570182c68a9c41e57b356124c301ca

> 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
>             Fix For: 0.6.0
>
>          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)