Package org.apache.beam.sdk.schemas
Interface SchemaProvider
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AutoValueSchema
,AvroRecordSchema
,DefaultSchema.DefaultSchemaProvider
,GetterBasedSchemaProvider
,JavaBeanSchema
,JavaFieldSchema
@Experimental(SCHEMAS) public interface SchemaProvider extends java.io.Serializable
Concrete implementations of this class allow creation of schema service objects that vend aSchema
for a specific type. One example use: creating aSchemaProvider
that contacts an external schema-registry service to determine the schema for a type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> @Nullable SerializableFunction<Row,T>
fromRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, returns a function that converts from aRow
object to that type.<T> @Nullable Schema
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 aRow
object If no schema exists, returns null.
-
-
-
Method Detail
-
schemaFor
<T> @Nullable Schema schemaFor(TypeDescriptor<T> typeDescriptor)
Lookup a schema for the given type. If no schema exists, returns null.
-
toRowFunction
<T> @Nullable SerializableFunction<T,Row> toRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, return a function that converts that type to aRow
object If no schema exists, returns null.
-
fromRowFunction
<T> @Nullable SerializableFunction<Row,T> fromRowFunction(TypeDescriptor<T> typeDescriptor)
Given a type, returns a function that converts from aRow
object to that type. If no schema exists, returns null.
-
-