Class ConvertHelpers
java.lang.Object
org.apache.beam.sdk.schemas.utils.ConvertHelpers
Helper functions for converting between equivalent schema types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Return value after converting a schema. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ConvertHelpers.ConvertedSchemaInformation
<T> getConvertedSchemaInformation
(Schema inputSchema, TypeDescriptor<T> outputType, SchemaRegistry schemaRegistry) Get the coder used for converting from an inputSchema to a given type.static <OutputT> SerializableFunction
<?, OutputT> getConvertPrimitive
(Schema.FieldType fieldType, TypeDescriptor<?> outputTypeDescriptor, ByteBuddyUtils.TypeConversionsFactory typeConversionsFactory) Returns a function to convert a Row into a primitive type.
-
Constructor Details
-
ConvertHelpers
public ConvertHelpers()
-
-
Method Details
-
getConvertedSchemaInformation
public static <T> ConvertHelpers.ConvertedSchemaInformation<T> getConvertedSchemaInformation(Schema inputSchema, TypeDescriptor<T> outputType, SchemaRegistry schemaRegistry) Get the coder used for converting from an inputSchema to a given type. -
getConvertPrimitive
public static <OutputT> SerializableFunction<?,OutputT> getConvertPrimitive(Schema.FieldType fieldType, TypeDescriptor<?> outputTypeDescriptor, ByteBuddyUtils.TypeConversionsFactory typeConversionsFactory) Returns a function to convert a Row into a primitive type. This only works when the row schema contains a single field, and that field is convertible to the primitive type.
-