Class Schema.FieldType

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    Schema

    @Immutable
    public abstract static class Schema.FieldType
    extends java.lang.Object
    implements java.io.Serializable
    A descriptor of a single field type. This is a recursive descriptor, as nested types are allowed.
    See Also:
    Serialized Form
    • Constructor Detail

      • FieldType

        public FieldType()
    • Method Detail

      • getNullable

        public abstract java.lang.Boolean getNullable()
      • getCollectionElementType

        public abstract @Nullable Schema.FieldType getCollectionElementType()
      • getMapValueType

        public abstract @Nullable Schema.FieldType getMapValueType()
      • getRowSchema

        public abstract @Nullable Schema getRowSchema()
      • toBuilder

        public abstract org.apache.beam.sdk.schemas.Schema.FieldType.Builder toBuilder()
      • isLogicalType

        public boolean isLogicalType​(java.lang.String logicalTypeIdentifier)
      • getLogicalType

        public <LogicalTypeT extends Schema.LogicalType> LogicalTypeT getLogicalType​(java.lang.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)
      • array

        @Deprecated
        public static Schema.FieldType array​(Schema.FieldType elementType,
                                             boolean nullable)
        Deprecated.
        Set the nullability on the elementType instead
      • row

        public static Schema.FieldType row​(Schema schema)
        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
        public Schema.FieldType withMetadata​(java.util.Map<java.lang.String,​byte[]> metadata)
        Deprecated.
        use schema options instead.
        Set the metadata map for the type, overriding any existing metadata.
      • withMetadata

        @Deprecated
        public Schema.FieldType withMetadata​(java.lang.String key,
                                             byte[] metadata)
        Deprecated.
        use schema options instead.
        Returns a copy of the descriptor with metadata set for the given key.
      • withMetadata

        @Deprecated
        public Schema.FieldType withMetadata​(java.lang.String key,
                                             java.lang.String metadata)
        Deprecated.
        use schema options instead.
        Returns a copy of the descriptor with metadata set for the given key.
      • getAllMetadata

        @Deprecated
        public java.util.Map<java.lang.String,​byte[]> getAllMetadata()
        Deprecated.
        use schema options instead.
      • getMetadata

        @Deprecated
        public byte @Nullable [] getMetadata​(java.lang.String key)
        Deprecated.
        use schema options instead.
      • getMetadataString

        @Deprecated
        public java.lang.String getMetadataString​(java.lang.String key)
        Deprecated.
        use schema options instead.
      • equals

        public final boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • typesEqual

        public boolean typesEqual​(Schema.FieldType other)
        Returns true if two FieldTypes are equal.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object