You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Santiago Fraire Willemoës <sa...@gmail.com> on 2022/12/13 08:53:55 UTC

Is an enum's default only for IPC?

Hello people, I've started writing an avdl parser in rust for fun, and I
hit a roadblock with the Enum. I submitted an issue
https://issues.apache.org/jira/browse/AVRO-3687 but it seems I'm failing to
understand something.

Martin points out that an AVDL is an IPC, but I understand that AVDL can be
used to generate schemas as well. And I also found that an avsc can contain
a default.

I have 2 questions:

1. Is an enum's default only used for IPC?
2. What makes a schema a schema? if it is an avsc file?

I've been reading the docs but I cannot find anything related to it.

Thanks

Re: Is an enum's default only for IPC?

Posted by Thiruvalluvan MG <th...@yahoo.com.INVALID>.
 Hi,
Defaults are useful in any Schema resolution. As you know, schema resolution is performed when a reader expects a schema different from the schema of the data being read. Defaults are used when the reader's expected schema has a field that is not present in the schema for the actual date. If that missing field is an enum, then the default associated with the field is used, if such a default is defined. If there is no such default, then the default specified in the enum is used. If even that default is not defined, then an error ensues.
Contents of avsc file are considered the JSON representation of Avro schema. Typically, it would be a JSON object with a filed named "type". The exceptions are (1) union schema is represented as a JSON array and (2) primitive types of the form '{"type": "int"} can be abbreviated as '"int"'.
Thanks
Thiru 
    On Tuesday, 13 December, 2022 at 02:37:44 pm IST, Santiago Fraire Willemoës <sa...@gmail.com> wrote:  
 
 Hello people, I've started writing an avdl parser in rust for fun, and I
hit a roadblock with the Enum. I submitted an issue
https://issues.apache.org/jira/browse/AVRO-3687 but it seems I'm failing to
understand something.

Martin points out that an AVDL is an IPC, but I understand that AVDL can be
used to generate schemas as well. And I also found that an avsc can contain
a default.

I have 2 questions:

1. Is an enum's default only used for IPC?
2. What makes a schema a schema? if it is an avsc file?

I've been reading the docs but I cannot find anything related to it.

Thanks