avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Pachod <joseph.pac...@resurgences.com>
Subject Different behavior between SchemaValidator and SchemaCompatibility regarding aliased field
Date Tue, 17 Nov 2015 15:45:32 GMT
Hello

As visible there https://gist.github.com/cluelessjoe/a618509b61be73f0bfed,
I've a first schema with just one field and then a second schema with one
field named differently but aliased to the previous schema field name.

I manage to write with the first schema and read back with the second.

However, SchemaCompatibility and SchemaValidator yields different results :
the first works while the second throws an
org.apache.avro.SchemaValidationException.

The code is :
SchemaCompatibility.checkReaderWriterCompatibility(oneFieldSchemaWithRenamedFieldAndAlias,oneFieldSchema);
new
SchemaValidatorBuilder().canBeReadStrategy().validateAll().validate(oneFieldSchema,
Arrays.asList(oneFieldSchemaWithRenamedFieldAndAlias));// throws

To me it looks like SchemaValidator has a bug, yet I don't get why there's
both SchemaValidator  and SchemaCompatibility so it feels like I'm missing
something.

Thanks in advance

Cheers
-- 
*Joseph PACHOD*

Mime
View raw message