cloud-fan commented on code in PR #39942:
URL: https://github.com/apache/spark/pull/39942#discussion_r1105545893


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -1429,4 +1435,97 @@ trait CheckAnalysis extends PredicateHelper with 
LookupCatalog with QueryErrorsB
       case _ =>
     }
   }
+
+  def checkDefaultValuesInPlan(plan: LogicalPlan, isForV1: Boolean = false): 
Unit = {
+    // Do not check anything if the children are not resolved yet.
+    if (!plan.childrenResolved) return
+    plan match {
+      case AlterColumn(t: ResolvedTable, col: ResolvedFieldName, _, _, _, _,
+          Some(default: DefaultValueExpression)) =>
+        checkTableProvider(t.catalog, t.name, 
getTableProviderFromProp(t.table.properties()))
+        checkDefaultValue(default, t.name, col.name, col.field.dataType, 
isForV1)
+
+      case cmd: V2CreateTablePlan if 
cmd.columns.exists(_.defaultValue.isDefined) =>
+        val ident = cmd.name.asInstanceOf[ResolvedIdentifier]

Review Comment:
   It will make the `case` statement very long and hard to read. Let me improve 
it a little bit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to