Fabio Carneiro created AVRO-4358:
------------------------------------

             Summary: [C] Schema resolution maps enum values by index instead 
of symbol name
                 Key: AVRO-4358
                 URL: https://issues.apache.org/jira/browse/AVRO-4358
             Project: Apache Avro
          Issue Type: Bug
            Reporter: Fabio Carneiro


The resolved writer and resolved reader copy the writer's enum index into the 
reader's value without matching symbols by name 
(lang/c/src/resolved-writer.c:1739, lang/c/src/resolved-reader.c:1629). This 
causes the following issues:

- A writer with enum [RED, GREEN] and reader with enum [GREEN, RED]: the 
resolved reader would assign the same index to a different symbol.
- If the writer uses a symbol the reader doesn't have, the reader gets an 
out-of-range enum value instead of an error.

The proposed fix maps writer symbols to reader symbols by name when the 
resolver is created, failing if a reader does not have a certain symbol.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to