/** * Compares two AvroSchema objects for equality within the context of the given SchemaTable. * * @param schemaTable SchemaTable with which to resolve schema UIDs. * @param first one AvroSchema object to compare for equality. * @param second another AvroSchema object to compare for equality. * @return whether the two objects represent the same Schema. * @throws IOException in case of an error reading from the SchemaTable. */ public static boolean avroSchemaEquals( final FijiSchemaTable schemaTable, final AvroSchema first, final AvroSchema second ) throws IOException { final AvroSchemaResolver resolver = new SchemaTableAvroResolver(schemaTable); return Objects.equal(resolver.apply(first), resolver.apply(second)); }
while (it.hasNext()) { final AvroSchema avroSchema = it.next(); final Schema other = mSchemaResolver.apply(avroSchema); if (Objects.equal(schema, other)) { it.remove();
/** * Returns the default Avro schema to use to decode cells from this column, if any. * * <p> For Avro-encoded cells only. </p> * * @return the default Avro schema to use to decode cells from this column, if any. */ public Schema getDefaultReaderSchema() { Preconditions.checkState(isAvro()); if ((null == mDefaultReaderSchema) && (mCellSchema.getDefaultReader() != null)) { Preconditions.checkNotNull(mAvroSchemaResolver); mDefaultReaderSchema = mAvroSchemaResolver.apply(mCellSchema.getDefaultReader()); } return mDefaultReaderSchema; }