Class StaticSchemaInference
java.lang.Object
org.apache.beam.sdk.schemas.utils.StaticSchemaInference
A set of utilities for inferring a Beam
Schema
from static Java types.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Schema.FieldType
fieldFromType
(TypeDescriptor type, FieldValueTypeSupplier fieldValueTypeSupplier) Map a Java field type to a Beam Schema FieldType.static Schema
schemaFromClass
(TypeDescriptor<?> typeDescriptor, FieldValueTypeSupplier fieldValueTypeSupplier) Infer a schema from a Java class.static List
<FieldValueTypeInformation> sortBySchema
(List<FieldValueTypeInformation> types, Schema schema)
-
Constructor Details
-
StaticSchemaInference
public StaticSchemaInference()
-
-
Method Details
-
sortBySchema
public static List<FieldValueTypeInformation> sortBySchema(List<FieldValueTypeInformation> types, Schema schema) -
schemaFromClass
public static Schema schemaFromClass(TypeDescriptor<?> typeDescriptor, FieldValueTypeSupplier fieldValueTypeSupplier) Infer a schema from a Java class.Takes in a function to extract a list of field types from a class. Different callers may have different strategies for extracting this list: e.g. introspecting public member variables, public getter methods, or special annotations on the class.
-
fieldFromType
public static Schema.FieldType fieldFromType(TypeDescriptor type, FieldValueTypeSupplier fieldValueTypeSupplier) Map a Java field type to a Beam Schema FieldType.
-