Код: Выделить всё
enum ColorType {
BLUE,
YELLOW,
GREEN,
UNKNOWN
} = UNKNOWN;
У меня есть обновленная схема Avro с тем же перечисление, но расширенное значением BLACK.
Код: Выделить всё
enum ColorType {
BLUE,
YELLOW,
GREEN,
BLACK,
UNKNOWN
} = UNKNOWN;
Java-код выглядит следующим образом:
Код: Выделить всё
var jsonDecoder = DecoderFactory.get().jsonDecoder(TreeRecord.SCHEMA$, resourceAsStream);
return new SpecificDatumReader(TreeRecord.SCHEMA$).read(null, jsonDecoder);
Код: Выделить всё
org.apache.avro.AvroTypeException: Unknown symbol in enum BLACK
at org.apache.avro.io.JsonDecoder.readEnum(JsonDecoder.java:331)
at org.apache.avro.io.ResolvingDecoder.readEnum(ResolvingDecoder.java:261)
at org.apache.avro.generic.GenericDatumReader.readEnum(GenericDatumReader.java:268)
at org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:182)
Подробнее здесь: https://stackoverflow.com/questions/762 ... -value-was