Skip to content

Commit a6750dd

Browse files
committed
Review comments
1 parent a70e326 commit a6750dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionBase.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ abstract class TypeCoercionBase extends TypeCoercionHelper {
8787
}
8888
}
8989

90+
/**
91+
* A type coercion rule that implicitly casts default value expression in DDL statements
92+
* to expected types.
93+
*/
9094
object DefaultValueExpressionCoercion extends Rule[LogicalPlan] {
9195
override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
9296
case createTable @ CreateTable(_, cols, _, _, _) if createTable.resolved &&
@@ -130,6 +134,7 @@ abstract class TypeCoercionBase extends TypeCoercionHelper {
130134
castWiderOnlyLiterals = false))))
131135
}
132136
addColumns.copy(columnsToAdd = newCols)
137+
133138
case alterColumns @ AlterColumns(_, specs) if alterColumns.resolved &&
134139
specs.exists(_.newDefaultExpression.isDefined) =>
135140
val newSpecs = specs.map { c =>

0 commit comments

Comments
 (0)