abstract class TypeCoercionHelper extends AnyRef
- Alphabetic
- By Inheritance
- TypeCoercionHelper
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TypeCoercionHelper()
Abstract Value Members
- abstract def canCast(from: DataType, to: DataType): Boolean
Whether casting
fromastois valid. - 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.
- 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.
- 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.
- 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.
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def castIfNotSameType(expr: Expression, dt: DataType): Expression
- Attributes
- protected
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def findTypeForComplex(t1: DataType, t2: DataType, findTypeFunc: (DataType, DataType) => Option[DataType]): Option[DataType]
- Attributes
- protected
- def findWiderDateTimeType(d1: DatetimeType, d2: DatetimeType): DatetimeType
- Attributes
- protected
- 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
- def findWiderTypeWithoutStringPromotion(types: Seq[DataType]): Option[DataType]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def haveSameType(types: Seq[DataType]): Boolean
Check whether the given types are equal ignoring nullable, containsNull and valueContainsNull.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object AnsiDateTimeOperationsTypeCoercion
ANSI type coercion helper that matches against date-time expressions in order to type coerce children to expected types.
- object CaseWhenTypeCoercion
Type coercion helper that matches against a CaseWhen expression in order to type coerce different branches to a common type.
- object ConcatTypeCoercion
Type coercion helper that matches against Concat expressions in order to type coerce expression's children to expected types.
- object DateTimeOperationsTypeCoercion
Type coercion helper that matches against date-time expressions in order to type coerce children to expected types.
- object EltTypeCoercion
Type coercion helper that matches against Elt expression in order to type coerce expression's children to expected types.
- object FunctionArgumentTypeCoercion
Type coercion helper that matches against function expression in order to type coerce function argument types to expected types.
- object IfTypeCoercion
Type coercion helper that matches against an If expression in order to type coerce different branches to a common type.
- object ImplicitTypeCoercion
Type coercion helper that matches against expression in order to type coerce expression's input types to expected types.
- object InTypeCoercion
Type coercion helper that matches agaist In and InSubquery expressions in order to type coerce LHS and RHS to expected types.
- object MapZipWithTypeCoercion
Type coercion helper that matches against MapZipWith expressions in order to type coerce key types of input maps to a common type.
- 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
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)