Class StaticSchemaInference
- java.lang.Object
-
- org.apache.beam.sdk.schemas.utils.StaticSchemaInference
-
@Experimental(SCHEMAS) public class StaticSchemaInference extends java.lang.Object
A set of utilities for inferring a BeamSchema
from static Java types.
-
-
Constructor Summary
Constructors Constructor Description StaticSchemaInference()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Schema.FieldType
fieldFromType(TypeDescriptor type, FieldValueTypeSupplier fieldValueTypeSupplier)
Map a Java field type to a Beam Schema FieldType.static Schema
schemaFromClass(java.lang.Class<?> clazz, FieldValueTypeSupplier fieldValueTypeSupplier)
Infer a schema from a Java class.static java.util.List<FieldValueTypeInformation>
sortBySchema(java.util.List<FieldValueTypeInformation> types, Schema schema)
-
-
-
Method Detail
-
sortBySchema
public static java.util.List<FieldValueTypeInformation> sortBySchema(java.util.List<FieldValueTypeInformation> types, Schema schema)
-
schemaFromClass
public static Schema schemaFromClass(java.lang.Class<?> clazz, 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.
-
-