You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Hai Lu (Jira)" <ji...@apache.org> on 2019/11/07 00:07:01 UTC

[jira] [Updated] (SAMZA-2347) Samza-sql: Fix AvroTypeFactoryImpl to properly denote a field as optional and nullable.

     [ https://issues.apache.org/jira/browse/SAMZA-2347?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hai Lu updated SAMZA-2347:
--------------------------
    Fix Version/s: 1.3

> Samza-sql: Fix AvroTypeFactoryImpl to properly denote a field as optional and nullable.
> ---------------------------------------------------------------------------------------
>
>                 Key: SAMZA-2347
>                 URL: https://issues.apache.org/jira/browse/SAMZA-2347
>             Project: Samza
>          Issue Type: Bug
>            Reporter: Aditya Toomula
>            Assignee: Aditya Toomula
>            Priority: Major
>             Fix For: 1.3
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> * Nullable fields in avro are of type union with one of the values being null.
> * Fields with default values are optional ONLY while reading. Default values are
> * meant for schema evolution where reader schema is different from writer schema.
> * Please note here that even the fields with default values MUST be specified at
> * the time of serialization.
> *
> * Behavior on the consumption side:
> * While reading, the fields that are not written will be filled with default values
> * that are specified in the reader schema. Please note that this happens only when
> * the field with default value is not present in writer schema but is present in
> * reader schema.
> *
> * Behavior on the producer side:
> * All non-nullable avro fields should have values including fields with default values.
> * Nullable fields need not be explicitly set as they are set at the time of serialization.
> *
> * So, all nullable fields are optional fields on the producer side in Avro.
> * \{@link AvroTypeFactoryImpl} reflects the state of fields on the producer side.
> *
> * Note: There could be cases where the producer might embed some fields, in which case
> * a non-nullable field is considered optional.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)