Class ConvertHelpers
- java.lang.Object
-
- org.apache.beam.sdk.schemas.utils.ConvertHelpers
-
@Experimental(SCHEMAS) public class ConvertHelpers extends java.lang.Object
Helper functions for converting between equivalent schema types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConvertHelpers.ConvertedSchemaInformation<T>
Return value after converting a schema.
-
Constructor Summary
Constructors Constructor Description ConvertHelpers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static <OutputT> SerializableFunction<?,OutputT>
getConvertPrimitive(Schema.FieldType fieldType, TypeDescriptor<?> outputTypeDescriptor, ByteBuddyUtils.TypeConversionsFactory typeConversionsFactory)
Returns a function to convert a Row into a primitive type.
-
-
-
Method Detail
-
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.
-
-