private static boolean avroReadWriteSchemasCompatible(Schema writer,
Schema reader) {
Symbol rootSymbol;
try {
ResolvingGrammarGenerator g = new ResolvingGrammarGenerator();
rootSymbol = g.generate(writer, reader);
} catch (IOException e) {
throw new DatasetException("IOException while generating grammar.", e);
}
return !hasErrorSymbol(rootSymbol);