Class StringHelper

Object
org.apache.spark.sql.types.StringHelper

public class StringHelper extends Object
  • Constructor Details

    • StringHelper

      public StringHelper()
  • Method Details

    • tryCompare

      public static scala.Option<Object> tryCompare(StringConstraint x, StringConstraint y)
    • lteq

      public static boolean lteq(StringConstraint x, StringConstraint y)
    • gteq

      public static boolean gteq(StringConstraint x, StringConstraint y)
    • equiv

      public static boolean equiv(StringConstraint x, StringConstraint y)
    • isPlainString

      public static boolean isPlainString(StringType s)
    • plainStringType

      public static DataType plainStringType(DataType dt)
      Strip CHAR/VARCHAR length constraints, preserving collation.

      Used by transforming string expressions (upper, substr, concat, ...) so their result type is plain STRING even when inputs are CharType/VarcharType, when standard semantics are on.

      Parameters:
      dt - (undocumented)
      Returns:
      (undocumented)
    • plainStringType

      public static StringType plainStringType(StringType s)
    • isMoreConstrained

      public static boolean isMoreConstrained(StringType a, StringType b)
    • tightestCommonString

      public static scala.Option<StringType> tightestCommonString(StringType s1, StringType s2)
      Least common string type: CHAR -> VARCHAR -> STRING, with length max(n, m) when the result remains CHAR or VARCHAR.

      When first-class CHAR/VARCHAR are off, always widens to unbounded STRING (legacy annotated-STRING path where Char/Varchar do not appear in plans).

      Parameters:
      s1 - (undocumented)
      s2 - (undocumented)
      Returns:
      (undocumented)
    • removeCollation

      public static StringType removeCollation(StringType s)
    • lt

      public static boolean lt(T x, T y)
    • gt

      public static boolean gt(T x, T y)
    • reverse

      public static scala.math.PartialOrdering<T> reverse()
    • canEqual

      public abstract static boolean canEqual(Object that)
    • equals

      public abstract static boolean equals(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()