szehon-ho commented on code in PR #50701: URL: https://github.com/apache/spark/pull/50701#discussion_r2071075799
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala: ########## @@ -3994,10 +3994,45 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor c.markAsAnalyzed(AnalysisContext.get) case c: KeepAnalyzedQuery if c.resolved => c.storeAnalyzedQuery() - case p: LogicalPlan if p.resolved => - p.transformAllExpressionsWithPruning(_.containsPattern(ANALYSIS_AWARE_EXPRESSION)) { - case e: AnalysisAwareExpression[_] => e.markAsAnalyzed() + case c: CreateTable if c.resolved => + c.copy(columns = storeDefaultForColumnDefinition(c.columns)) + case r: ReplaceTable if r.resolved => + r.copy(columns = storeDefaultForColumnDefinition(r.columns)) + case a: AddColumns => + // Wrap analysis errors for default values in a more user-friendly message. + a.columnsToAdd.foreach { c => Review Comment: note: This is to throw the previously expected exception (defaultValueUnresolved). Tried to move it to CheckAnalysis, but its a bit too late and the more generic Unresolved exception is already thrown there if any Expression is still unresolved, before it gets to the checkAlterTable part. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org