private static Schema getReaderSchema(KijiTableLayout 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 InternalKijiError(
"Unknown AvroReaderSchemaType: " + spec.getColumnReaderSpec().getAvroReaderSchemaType());