public static Schema<?> getSchema(SchemaInfo schemaInfo) { switch (schemaInfo.getType()) { case INT8: return ByteSchema.of(); case INT16: return ShortSchema.of(); case INT32: return IntSchema.of(); case INT64: return LongSchema.of(); case STRING: return StringSchema.utf8(); case FLOAT: return FloatSchema.of(); case DOUBLE: return DoubleSchema.of(); case BYTES: return BytesSchema.of(); case JSON: case AVRO: return GenericSchema.of(schemaInfo); default: throw new IllegalArgumentException("Retrieve schema instance from schema info for type '" + schemaInfo.getType() + "' is not supported yet"); } } }
static Schema<?> getSchema(SchemaInfo schemaInfo) { switch (schemaInfo.getType()) { case INT8: return ByteSchema.of(); case INT16: return ShortSchema.of(); case INT32: return IntSchema.of(); case INT64: return LongSchema.of(); case STRING: return StringSchema.utf8(); case FLOAT: return FloatSchema.of(); case DOUBLE: return DoubleSchema.of(); case BYTES: return BytesSchema.of(); case JSON: case AVRO: return GenericSchema.of(schemaInfo); default: throw new IllegalArgumentException("Retrieve schema instance from schema info for type '" + schemaInfo.getType() + "' is not supported yet"); } } }