Class ExplicitUTF8BinaryStringType

Object
org.apache.spark.sql.types.ExplicitUTF8BinaryStringType

public class ExplicitUTF8BinaryStringType extends Object
Used in the context of UDFs when resolving parameters/return types.

For example, if a UDF parameter is defined as p1 STRING COLLATE UTF8_BINARY, calling typeName() will return just STRING, omitting the collation information. This causes the parameter to be parsed into the companion object StringType. If the UDF has a default collation specified, it will be applied to the companion object StringType, potentially resulting in the construction of a StringType with an invalid collation.

  • Constructor Details

    • ExplicitUTF8BinaryStringType

      public ExplicitUTF8BinaryStringType()
  • Method Details

    • typeName

      public static String typeName()
    • toString

      public static String toString()
    • transform

      public static DataType transform(DataType dataType)
      Transforms the given dataType by replacing each StringType that has an explicit UTF8_BINARY collation with ExplicitUTF8BinaryStringType.
      Parameters:
      dataType - (undocumented)
      Returns:
      (undocumented)
    • transformDefaultStringType

      public static DataType transformDefaultStringType(DataType dataType)
      Transforms the given dataType by replacing each companion object StringType with explicit UTF8_BINARY StringType.
      Parameters:
      dataType - (undocumented)
      Returns:
      (undocumented)
    • 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()
    • collationId

      public static int collationId()
    • constraint

      public static StringConstraint constraint()
    • equals

      public static boolean equals(Object obj)
    • hashCode

      public static int hashCode()
    • defaultSize

      public static int defaultSize()