/** * 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; }
return parser.parse(cellSchema.getValue()); case AVRO: AvroSchema avroSchema = cellSchema.getDefaultReader(); if (avroSchema.getUid() != null) { return schemaTable.getSchema(avroSchema.getUid());
AvroSchema as = cellSchema.getDefaultReader(); if (as.getUid() != null) { Schema schema = schemaTable.getSchema(as.getUid());
if (cellSchema.getDefaultReader() != null) { normalizeAvroSchema(cellSchema.getDefaultReader(), options);
/** * Get the Avro Schema to use to decode cells. * * @param layout FijiTableLayout from which to get storage information. * @param spec Specification of the cell encoding. * @return the Avro Schema to use to decode cells. * @throws IOException in case the specified column does not exist. */ private static Schema getReaderSchema(FijiTableLayout layout, BoundColumnReaderSpec spec) throws IOException { switch (spec.getColumnReaderSpec().getAvroReaderSchemaType()) { case DEFAULT: { final CellSchema cellSchema = layout.getCellSchema(spec.getColumn()); final SchemaTableAvroResolver resolver = new SchemaTableAvroResolver(layout.getSchemaTable()); return resolver.apply(cellSchema.getDefaultReader()); } case EXPLICIT: return spec.getColumnReaderSpec().getAvroReaderSchema(); case WRITER: return null; default: throw new InternalFijiError( "Unknown AvroReaderSchemaType: " + spec.getColumnReaderSpec().getAvroReaderSchemaType()); } }