TypeCoercionRule Contract — Type Coercion Rules
TypeCoercionRule
is the contract of logical rules to coerce and propagate types in logical plans.
1 2 3 4 5 6 7 8 9 10 11 |
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 } |
Method | Description |
---|---|
|
Coerce types in a logical plan Used exclusively when |
TypeCoercionRule
is simply a Catalyst rule for transforming logical plans, i.e. Rule[LogicalPlan]
.
TypeCoercionRule | Description |
---|---|
CaseWhenCoercion |
|
ConcatCoercion |
|
DecimalPrecision |
|
Division |
|
EltCoercion |
|
FunctionArgumentConversion |
|
IfCoercion |
|
ImplicitTypeCasts |
|
PromoteStrings |
|
StackCoercion |
|
Executing Rule — apply
Method
1 2 3 4 5 |
apply(plan: LogicalPlan): LogicalPlan |
Note
|
apply is part of the Rule Contract to execute (apply) a rule on a TreeNode (e.g. LogicalPlan).
|
apply
coerceTypes in the input LogicalPlan and returns the following:
-
The input LogicalPlan itself if matches the coerced plan
-
The plan after propagateTypes on the coerced plan
propagateTypes
Internal Method
1 2 3 4 5 |
propagateTypes(plan: LogicalPlan): LogicalPlan |
propagateTypes
…FIXME
Note
|
propagateTypes is used exclusively when TypeCoercionRule is executed.
|