Class StringType

Object
org.apache.spark.sql.types.DataType
org.apache.spark.sql.types.StringType
All Implemented Interfaces:
Serializable

public class StringType extends DataType implements Serializable
The data type representing String values. Please use the singleton DataTypes.StringType.

Since:
1.3.0 param: collationId The id of collation for this StringType.
See Also:
  • Constructor Details

    • StringType

      public StringType()
  • Method Details

    • apply

      public static StringType apply(String collation)
    • json

      public static String json()
    • prettyJson

      public static String prettyJson()
    • simpleString

      public static String simpleString()
    • catalogString

      public static String catalogString()
    • sql

      public static String sql()
    • canEqual

      public abstract static boolean canEqual(Object that)
    • productArity

      public abstract static int productArity()
    • productElement

      public abstract static Object productElement(int n)
    • productIterator

      public static scala.collection.Iterator<Object> productIterator()
    • productPrefix

      public static String productPrefix()
    • productElementName

      public static String productElementName(int n)
    • productElementNames

      public static scala.collection.Iterator<String> productElementNames()
    • collationId

      public int collationId()
    • supportsBinaryEquality

      public boolean supportsBinaryEquality()
      Support for Binary Equality implies that strings are considered equal only if they are byte for byte equal. E.g. all accent or case-insensitive collations are considered non-binary. If this field is true, byte level operations can be used against this datatype (e.g. for equality and hashing).
      Returns:
      (undocumented)
    • isUTF8BinaryCollation

      public boolean isUTF8BinaryCollation()
    • isUTF8BinaryLcaseCollation

      public boolean isUTF8BinaryLcaseCollation()
    • supportsBinaryOrdering

      public boolean supportsBinaryOrdering()
      Support for Binary Ordering implies that strings are considered equal only if they are byte for byte equal. E.g. all accent or case-insensitive collations are considered non-binary. Also their ordering does not require calls to ICU library, as it follows spark internal implementation. If this field is true, byte level operations can be used against this datatype (e.g. for equality, hashing and ordering).
      Returns:
      (undocumented)
    • typeName

      public String typeName()
      Type name that is shown to the customer. If this is an UTF8_BINARY collation output is string due to backwards compatibility.
      Overrides:
      typeName in class DataType
      Returns:
      (undocumented)
    • jsonValue

      public org.json4s.JValue jsonValue()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • defaultSize

      public int defaultSize()
      The default size of a value of the StringType is 20 bytes.
      Specified by:
      defaultSize in class DataType
      Returns:
      (undocumented)