You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/11/14 13:48:25 UTC

[GitHub] [avro] spiegela commented on pull request #1921: AVRO-3646: serde for enum with mixed variants

spiegela commented on PR #1921:
URL: https://github.com/apache/avro/pull/1921#issuecomment-1313738237

   To make sure I understand the status of change, is the remaining question here how the AvroSchema derive should _”choose”_ which enum format to use when constructing the schema?
   
   If so, I was thinking that the AvroSchema derive _could_ infer the correct behavior based on the variant characteristics:
   * All unit variants, create an enum schema as we do today.
   * 1+ non-unit variants with either named fields, or single field unnamed fields, use the Record-style (as in this PR) as the schema.
   
   That leaves the case of non-unit, multi-field, unnamed fields 😅. For those, we should return a compile error, I think, and let the dev implement `AvroSchemaComponent` themselves — otherwise, _could_ add Record fields named `0`, `1`, …


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org