case INLINE: { try { return new Schema.Parser().parse(cellSchema.getValue()); } catch (RuntimeException re) { throw new InvalidLayoutException(String.format( "Invalid Avro schema: '%s' caused error: %s.", cellSchema.getValue(), re.getMessage())); final String className = cellSchema.getValue(); return getSchemaFromClass(className);
/** * Get the Avro Schema for a given column marked FINAL in a given layout. This will either be * defined INLINE as a Schema JSON or it will be the only writer schema in the layout 1.3+ * Avro writers field. * * @param layout table layout from which to get the Schema for the given column. * @param column column for which to get the Schema. * @return Avro Schema of the given column. * @throws NoSuchColumnException in case the column does not exist. */ private static Schema getSchemaForFinalColumn(FijiTableLayout layout, FijiColumnName column) throws NoSuchColumnException { final List<AvroSchema> writers = layout.getCellSchema(column).getWriters(); if (null == writers) { return new Schema.Parser().parse(layout.getCellSchema(column).getValue()); } else { Preconditions.checkState(writers.size() == 1, "FINAL columns must have exactly one writer schema, found: " + writers); return new SchemaTableAvroResolver(layout.getSchemaTable()).apply(writers.get(0)); } }
mAvroReaderSchema = AvroReaderSchema.EXPLICIT; try { mReaderSchema = new Schema.Parser().parse(cellSchema.getValue()); } catch (RuntimeException re) { throw new InvalidLayoutException(String.format( "Invalid Avro schema '%s' caused error: %s.", cellSchema.getValue(), re.getMessage())); mAvroReaderSchema = AvroReaderSchema.EXPLICIT; try { mReaderSchema = getSchemaFromClass(cellSchema.getValue()); } catch (SchemaClassNotFoundException scnfe) {
FIJI_AVRO_TYPE_TO_CLASS_MAP.get(schemaType)); } else { throw new IOException("Unsupported described output type: " + cellSchema.getValue()); if (FIJI_CELL_TYPE_TO_CLASS_MAP.containsKey(cellSchema.getValue())) { columnNameClassMap.put(fijiColumnName, FIJI_CELL_TYPE_TO_CLASS_MAP.get(cellSchema.getValue())); } else { throw new IOException("Unsupported described output type: " + cellSchema.getValue());
CellSpec.readAvroSchema(schema); } catch (SchemaClassNotFoundException scnfe) { LOG.debug(String.format("Avro schema class '%s' not found.", schema.getValue())); && !Objects.equal(schema.getValue(), reference.getValue())) { throw new InvalidLayoutException(String.format( "Final column schema cannot be modified from %s to %s.",