Package org.apache.beam.sdk.schemas
Class Schema.FieldType
java.lang.Object
org.apache.beam.sdk.schemas.Schema.FieldType
- All Implemented Interfaces:
Serializable
- Enclosing class:
Schema
A descriptor of a single field type. This is a recursive descriptor, as nested types are
allowed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Schema.FieldType
The type of boolean fields.static final Schema.FieldType
The type of byte fields.static final Schema.FieldType
The type of bytes fields.static final Schema.FieldType
The type of datetime fields.static final Schema.FieldType
The type of decimal fields.static final Schema.FieldType
The type of double fields.static final Schema.FieldType
The type of float fields.static final Schema.FieldType
The type of int16 fields.static final Schema.FieldType
The type of int32 fields.static final Schema.FieldType
The type of int64 fields.static final Schema.FieldType
The type of string fields. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Schema.FieldType
array
(Schema.FieldType elementType) Create an array type for the given field type.static Schema.FieldType
array
(Schema.FieldType elementType, boolean nullable) Deprecated.Set the nullability on the elementType insteadfinal boolean
boolean
equivalent
(Schema.FieldType other, Schema.EquivalenceNullablePolicy nullablePolicy) Check whether two types are equivalent.static org.apache.beam.sdk.schemas.Schema.FieldType.Builder
forTypeName
(Schema.TypeName typeName) Deprecated.use schema options instead.abstract @Nullable Schema.FieldType
abstract @Nullable Schema.LogicalType
<?, ?> <InputT,
BaseT, LogicalTypeT extends Schema.LogicalType<InputT, BaseT>>
LogicalTypeTgetLogicalType
(Class<LogicalTypeT> logicalTypeClass) Helper function for retrieving the concrete logical type subclass.abstract @Nullable Schema.FieldType
abstract @Nullable Schema.FieldType
byte @Nullable []
getMetadata
(String key) Deprecated.use schema options instead.getMetadataString
(String key) Deprecated.use schema options instead.abstract Boolean
abstract Schema.TypeName
final int
hashCode()
boolean
isLogicalType
(String logicalTypeIdentifier) static Schema.FieldType
iterable
(Schema.FieldType elementType) static <InputT,
BaseT>
Schema.FieldTypelogicalType
(Schema.LogicalType<InputT, BaseT> logicalType) Creates a logical type based on a primitive field type.static Schema.FieldType
map
(Schema.FieldType keyType, Schema.FieldType valueType) Create a map type for the given key and value types.static Schema.FieldType
map
(Schema.FieldType keyType, Schema.FieldType valueType, boolean valueTypeNullable) Deprecated.Set the nullability on the valueType insteadstatic Schema.FieldType
of
(Schema.TypeName typeName) Create aSchema.FieldType
for the given type.static Schema.FieldType
Create a map type for the given key and value types.abstract org.apache.beam.sdk.schemas.Schema.FieldType.Builder
final String
toString()
boolean
typesEqual
(Schema.FieldType other) Returns true if two FieldTypes are equal.withMetadata
(String key, byte[] metadata) Deprecated.use schema options instead.withMetadata
(String key, String metadata) Deprecated.use schema options instead.withMetadata
(Map<String, byte[]> metadata) Deprecated.use schema options instead.withNullable
(boolean nullable)
-
Field Details
-
STRING
The type of string fields. -
BYTE
The type of byte fields. -
BYTES
The type of bytes fields. -
INT16
The type of int16 fields. -
INT32
The type of int32 fields. -
INT64
The type of int64 fields. -
FLOAT
The type of float fields. -
DOUBLE
The type of double fields. -
DECIMAL
The type of decimal fields. -
BOOLEAN
The type of boolean fields. -
DATETIME
The type of datetime fields.
-
-
Constructor Details
-
FieldType
public FieldType()
-
-
Method Details
-
getTypeName
-
getNullable
-
getLogicalType
-
getCollectionElementType
-
getMapKeyType
-
getMapValueType
-
getRowSchema
-
toBuilder
public abstract org.apache.beam.sdk.schemas.Schema.FieldType.Builder toBuilder() -
isLogicalType
-
getLogicalType
public <InputT,BaseT, LogicalTypeT getLogicalTypeLogicalTypeT extends Schema.LogicalType<InputT, BaseT>> (Class<LogicalTypeT> logicalTypeClass) Helper function for retrieving the concrete logical type subclass. -
forTypeName
public static org.apache.beam.sdk.schemas.Schema.FieldType.Builder forTypeName(Schema.TypeName typeName) -
of
Create aSchema.FieldType
for the given type. -
array
Create an array type for the given field type. -
array
Deprecated.Set the nullability on the elementType instead -
iterable
-
map
Create a map type for the given key and value types. -
map
@Deprecated public static Schema.FieldType map(Schema.FieldType keyType, Schema.FieldType valueType, boolean valueTypeNullable) Deprecated.Set the nullability on the valueType instead -
row
Create a map type for the given key and value types. -
logicalType
public static <InputT,BaseT> Schema.FieldType logicalType(Schema.LogicalType<InputT, BaseT> logicalType) Creates a logical type based on a primitive field type. -
withMetadata
Deprecated.use schema options instead.Set the metadata map for the type, overriding any existing metadata. -
withMetadata
Deprecated.use schema options instead.Returns a copy of the descriptor with metadata set for the given key. -
withMetadata
Deprecated.use schema options instead.Returns a copy of the descriptor with metadata set for the given key. -
getAllMetadata
Deprecated.use schema options instead. -
getMetadata
Deprecated.use schema options instead. -
getMetadataString
Deprecated.use schema options instead. -
withNullable
-
equals
-
typesEqual
Returns true if two FieldTypes are equal. -
equivalent
Check whether two types are equivalent. -
hashCode
public final int hashCode() -
toString
-