Skip to content

TypeCoercionRule -- Type Coercion Rules

TypeCoercionRule is the <> of <> to <> and <> types in <>.

[[contract]] [source, scala]


package org.apache.spark.sql.catalyst.analysis

trait TypeCoercionRule extends Rule[LogicalPlan] { // only required methods that have no implementation // the others follow def coerceTypes(plan: LogicalPlan): LogicalPlan }


.(Subset of) TypeCoercionRule Contract [cols="1m,2",options="header",width="100%"] |=== | Method | Description

| coerceTypes | [[coerceTypes]] Coerce types in a <>

Used exclusively when TypeCoercionRule is <> |===

TypeCoercionRule is simply a <> for transforming <>, i.e. Rule[LogicalPlan].

[[implementations]] .TypeCoercionRules [cols="1,2",options="header",width="100%"] |=== | TypeCoercionRule | Description

| CaseWhenCoercion | [[CaseWhenCoercion]]

| ConcatCoercion | [[ConcatCoercion]]

| DecimalPrecision | [[DecimalPrecision]]

| Division | [[Division]]

| EltCoercion | [[EltCoercion]]

| FunctionArgumentConversion | [[FunctionArgumentConversion]]

| IfCoercion | [[IfCoercion]]

| ImplicitTypeCasts | [[ImplicitTypeCasts]]

| InConversion | [[InConversion]]

| PromoteStrings | [[PromoteStrings]]

| StackCoercion | [[StackCoercion]]

| WindowFrameCoercion | [[WindowFrameCoercion]] |===

Executing Rule

apply(plan: LogicalPlan): LogicalPlan

apply <> in the input <> and returns the following:

  • The input <> itself if matches the coerced plan

  • The plan after <> on the coerced plan

apply is part of the Rule abstraction.

=== [[propagateTypes]] propagateTypes Internal Method

[source, scala]

propagateTypes(plan: LogicalPlan): LogicalPlan

propagateTypes...FIXME

NOTE: propagateTypes is used exclusively when TypeCoercionRule is <>.


Last update: 2020-10-21
Back to top