Packages

c

org.apache.spark.sql.catalyst.analysis

TypeCoercionHelper

abstract class TypeCoercionHelper extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypeCoercionHelper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TypeCoercionHelper()

Abstract Value Members

  1. abstract def canCast(from: DataType, to: DataType): Boolean

    Whether casting from as to is valid.

  2. abstract val findTightestCommonType: (DataType, DataType) => Option[DataType]

    Find the tightest common type of two types that might be used in a binary expression.

    Find the tightest common type of two types that might be used in a binary expression. This handles all numeric types except fixed-precision decimals interacting with each other or with primitive types, because in that case the precision and scale of the result depends on the operation. Those rules are implemented in DecimalPrecision.

  3. abstract def findWiderCommonType(types: Seq[DataType]): Option[DataType]

    Looking for a widened data type of a given sequence of data types with some acceptable loss of precision.

    Looking for a widened data type of a given sequence of data types with some acceptable loss of precision. E.g. there is no common type for double and decimal because double's range is larger than decimal, and yet decimal is more precise than double, but in union we would cast the decimal into double.

  4. abstract def findWiderTypeForTwo(t1: DataType, t2: DataType): Option[DataType]

    Looking for a widened data type of two given data types with some acceptable loss of precision.

    Looking for a widened data type of two given data types with some acceptable loss of precision. E.g. there is no common type for double and decimal because double's range is larger than decimal, and yet decimal is more precise than double, but in union we would cast the decimal into double.

  5. abstract def implicitCast(e: Expression, expectedType: AbstractDataType): Option[Expression]

    Given an expected data type, try to cast the expression and return the cast expression.

    Given an expected data type, try to cast the expression and return the cast expression.

    If the expression already fits the input type, we simply return the expression itself. If the expression has an incompatible type that cannot be implicitly cast, return None.

  6. abstract def typeCoercionRules: List[Rule[LogicalPlan]]

    A collection of Rule that can be used to coerce differing types that participate in operations into compatible ones.

Concrete 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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def castIfNotSameType(expr: Expression, dt: DataType): Expression
    Attributes
    protected
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def findTypeForComplex(t1: DataType, t2: DataType, findTypeFunc: (DataType, DataType) => Option[DataType]): Option[DataType]
    Attributes
    protected
  10. def findWiderDateTimeType(d1: DatetimeType, d2: DatetimeType): DatetimeType
    Attributes
    protected
  11. def findWiderTypeForDecimal(dt1: DataType, dt2: DataType): Option[DataType]

    Finds a wider type when one or both types are decimals.

    Finds a wider type when one or both types are decimals. If the wider decimal type exceeds system limitation, this rule will truncate the decimal type. If a decimal and other fractional types are compared, returns a double type.

    Attributes
    protected
  12. def findWiderTypeWithoutStringPromotion(types: Seq[DataType]): Option[DataType]
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. def haveSameType(types: Seq[DataType]): Boolean

    Check whether the given types are equal ignoring nullable, containsNull and valueContainsNull.

  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. object AnsiDateTimeOperationsTypeCoercion

    ANSI type coercion helper that matches against date-time expressions in order to type coerce children to expected types.

  26. object CaseWhenTypeCoercion

    Type coercion helper that matches against a CaseWhen expression in order to type coerce different branches to a common type.

  27. object ConcatTypeCoercion

    Type coercion helper that matches against Concat expressions in order to type coerce expression's children to expected types.

  28. object DateTimeOperationsTypeCoercion

    Type coercion helper that matches against date-time expressions in order to type coerce children to expected types.

  29. object EltTypeCoercion

    Type coercion helper that matches against Elt expression in order to type coerce expression's children to expected types.

  30. object FunctionArgumentTypeCoercion

    Type coercion helper that matches against function expression in order to type coerce function argument types to expected types.

  31. object IfTypeCoercion

    Type coercion helper that matches against an If expression in order to type coerce different branches to a common type.

  32. object ImplicitTypeCoercion

    Type coercion helper that matches against expression in order to type coerce expression's input types to expected types.

  33. object InTypeCoercion

    Type coercion helper that matches agaist In and InSubquery expressions in order to type coerce LHS and RHS to expected types.

  34. object MapZipWithTypeCoercion

    Type coercion helper that matches against MapZipWith expressions in order to type coerce key types of input maps to a common type.

  35. object WindowFrameTypeCoercion

    Type coercion helper that matches against WindowFrameTypeCoercion expression in order to type coerce window boundaries to the type they operate upon.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped