Packages

object Cast extends QueryErrorsBase with Serializable

Linear Supertypes
Serializable, QueryErrorsBase, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cast
  2. Serializable
  3. QueryErrorsBase
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val BY_TABLE_INSERTION: TreeNodeTag[Unit]

    A tag to identify if a CAST added by the table insertion resolver.

  5. val USER_SPECIFIED_CAST: TreeNodeTag[Boolean]

    A tag to decide if a CAST is specified by user.

  6. def apply(child: Expression, dataType: DataType, timeZoneId: Option[String], ansiEnabled: Boolean): Cast
  7. def apply(child: Expression, dataType: DataType, ansiEnabled: Boolean): Cast
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def canANSIStoreAssign(from: DataType, to: DataType): Boolean

    Returns true iff we can cast the from type to to type as per the ANSI SQL.

    Returns true iff we can cast the from type to to type as per the ANSI SQL. In practice, the behavior is mostly the same as PostgreSQL. It disallows certain unreasonable type conversions such as converting string to int or double to boolean.

  10. def canAnsiCast(from: DataType, to: DataType): Boolean

    As per section 6.13 "cast specification" in "Information technology — Database languages " + "- SQL — Part 2: Foundation (SQL/Foundation)": If the <cast operand> is a <value expression>, then the valid combinations of TD and SD in a <cast specification> are given by the following table.

    As per section 6.13 "cast specification" in "Information technology — Database languages " + "- SQL — Part 2: Foundation (SQL/Foundation)": If the <cast operand> is a <value expression>, then the valid combinations of TD and SD in a <cast specification> are given by the following table. "Y" indicates that the combination is syntactically valid without restriction; "M" indicates that the combination is valid subject to other Syntax Rules in this Sub- clause being satisfied; and "N" indicates that the combination is not valid: SD TD EN AN C D T TS YM DT BO UDT B RT CT RW EN Y Y Y N N N M M N M N M N N AN Y Y Y N N N N N N M N M N N C Y Y Y Y Y Y Y Y Y M N M N N D N N Y Y N Y N N N M N M N N T N N Y N Y Y N N N M N M N N TS N N Y Y Y Y N N N M N M N N YM M N Y N N N Y N N M N M N N DT M N Y N N N N Y N M N M N N BO N N Y N N N N N Y M N M N N UDT M M M M M M M M M M M M M N B N N N N N N N N N M Y M N N RT M M M M M M M M M M M M N N CT N N N N N N N N N M N N M N RW N N N N N N N N N N N N N M

    Where: EN = Exact Numeric AN = Approximate Numeric C = Character (Fixed- or Variable-Length, or Character Large Object) D = Date T = Time TS = Timestamp YM = Year-Month Interval DT = Day-Time Interval BO = Boolean UDT = User-Defined Type B = Binary (Fixed- or Variable-Length or Binary Large Object) RT = Reference type CT = Collection type RW = Row type

    Spark's ANSI mode follows the syntax rules, except it specially allow the following straightforward type conversions which are disallowed as per the SQL standard:

    • Numeric <=> Boolean
    • String <=> Binary
  11. def canCast(from: DataType, to: DataType): Boolean

    Returns true iff we can cast from type to to type.

  12. def canNullSafeCastToDecimal(from: DataType, to: DecimalType): Boolean
  13. def canTryCast(from: DataType, to: DataType): Boolean
  14. def canUpCast(from: DataType, to: DataType): Boolean

    Returns true iff we can safely up-cast the from type to to type without any truncating or precision lose or possible runtime failures.

    Returns true iff we can safely up-cast the from type to to type without any truncating or precision lose or possible runtime failures. For example, long -> int, string -> int are not up-cast.

  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  19. def forceNullable(from: DataType, to: DataType): Boolean

    Returns true if casting non-nullable values from from type to to type may return null.

    Returns true if casting non-nullable values from from type to to type may return null. Note that the caller side should take care of input nullability first and only call this method if the input is not nullable.

  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def getQueryContext(sqlContext: SQLQueryContext): Array[QueryContext]
    Definition Classes
    QueryErrorsBase
  22. def getSummary(sqlContext: SQLQueryContext): String
    Definition Classes
    QueryErrorsBase
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def needsTimeZone(from: DataType, to: DataType): Boolean

    Return true if we need to use the timeZone information casting from type to to type.

    Return true if we need to use the timeZone information casting from type to to type. The patterns matched reflect the current implementation in the Cast node. c.f. usage of timeZone in: * Cast.castToString * Cast.castToDate * Cast.castToTimestamp

  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def processFloatingPointSpecialLiterals(v: String, isFloat: Boolean): Any

    We process literals such as 'Infinity', 'Inf', '-Infinity' and 'NaN' etc in case insensitive manner to be compatible with other database systems such as PostgreSQL and DB2.

  30. def resolvableNullability(from: Boolean, to: Boolean): Boolean
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toDSOption(option: String): String
    Definition Classes
    QueryErrorsBase
  33. def toSQLConf(conf: String): String
    Definition Classes
    QueryErrorsBase
  34. def toSQLConfVal(conf: String): String
    Definition Classes
    QueryErrorsBase
  35. def toSQLExpr(e: Expression): String
    Definition Classes
    QueryErrorsBase
  36. def toSQLId(parts: String): String
    Definition Classes
    QueryErrorsBase
  37. def toSQLId(parts: Seq[String]): String
    Definition Classes
    QueryErrorsBase
  38. def toSQLSchema(schema: String): String
    Definition Classes
    QueryErrorsBase
  39. def toSQLStmt(text: String): String
    Definition Classes
    QueryErrorsBase
  40. def toSQLType(text: String): String
    Definition Classes
    QueryErrorsBase
  41. def toSQLType(t: AbstractDataType): String
    Definition Classes
    QueryErrorsBase
  42. def toSQLValue(v: Any, t: DataType): String
    Definition Classes
    QueryErrorsBase
  43. def toString(): String
    Definition Classes
    AnyRef → Any
  44. def typeCheckFailureMessage(from: DataType, to: DataType, fallbackConf: Option[(String, String)]): DataTypeMismatch
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from QueryErrorsBase

Inherited from AnyRef

Inherited from Any

Ungrouped