Class DefaultSchema.DefaultSchemaProvider
java.lang.Object
org.apache.beam.sdk.schemas.annotations.DefaultSchema.DefaultSchemaProvider
- All Implemented Interfaces:
Serializable
,SchemaProvider
- Enclosing class:
DefaultSchema
SchemaProvider
for default schemas. Looks up the provider annotated for a type, and
delegates to that provider.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> SerializableFunction
<Row, T> fromRowFunction
(TypeDescriptor<T> typeDescriptor) Given a type, returns a function that converts from aRow
object to that type.getUnderlyingSchemaProvider
(Class<T> clazz) Retrieves the underlyingSchemaProvider
for the givenClass
.getUnderlyingSchemaProvider
(TypeDescriptor<T> typeDescriptor) Retrieves the underlyingSchemaProvider
for the givenTypeDescriptor
.<T> Schema
schemaFor
(TypeDescriptor<T> typeDescriptor) Lookup a schema for the given type.<T> 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.
-
Constructor Details
-
DefaultSchemaProvider
public DefaultSchemaProvider()
-
-
Method Details
-
getUnderlyingSchemaProvider
Retrieves the underlyingSchemaProvider
for the givenTypeDescriptor
. If no provider is found, returns null. -
getUnderlyingSchemaProvider
Retrieves the underlyingSchemaProvider
for the givenClass
. If no provider is found, returns null. -
schemaFor
Description copied from interface:SchemaProvider
Lookup a schema for the given type. If no schema exists, returns null.- Specified by:
schemaFor
in interfaceSchemaProvider
-
toRowFunction
Given a type, return a function that converts that type to aRow
object If no schema exists, returns null.- Specified by:
toRowFunction
in interfaceSchemaProvider
-
fromRowFunction
Given a type, returns a function that converts from aRow
object to that type. If no schema exists, returns null.- Specified by:
fromRowFunction
in interfaceSchemaProvider
-