Package org.apache.beam.sdk.schemas
Interface SchemaProvider
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AutoValueSchema,AvroRecordSchema,AwsSchemaProvider,DefaultSchema.DefaultSchemaProvider,GetterBasedSchemaProvider,GetterBasedSchemaProviderV2,JavaBeanSchema,JavaFieldSchema,ProtoMessageSchema,ThriftSchema
Concrete implementations of this class allow creation of schema service objects that vend a
Schema for a specific type. One example use: creating a SchemaProvider that
contacts an external schema-registry service to determine the schema for a type.-
Method Summary
Modifier and TypeMethodDescription<T> @Nullable SerializableFunction<Row, T> fromRowFunction(TypeDescriptor<T> typeDescriptor) Given a type, returns a function that converts from aRowobject to that type.schemaFor(TypeDescriptor<T> typeDescriptor) Lookup a schema for the given type.<T> @Nullable SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor) Given a type, return a function that converts that type to aRowobject If no schema exists, returns null.
-
Method Details
-
schemaFor
Lookup a schema for the given type. If no schema exists, returns null. -
toRowFunction
Given a type, return a function that converts that type to aRowobject If no schema exists, returns null. -
fromRowFunction
Given a type, returns a function that converts from aRowobject to that type. If no schema exists, returns null.
-