LuciferYang commented on code in PR #46594:
URL: https://github.com/apache/spark/pull/46594#discussion_r1642237046


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ResolveDefaultColumnsUtil.scala:
##########
@@ -298,6 +299,21 @@ object ResolveDefaultColumns extends QueryErrorsBase
     val analyzed: Expression = plan.collectFirst {
       case Project(Seq(a: Alias), OneRowRelation()) => a.child
     }.get
+
+    if (!analyzed.foldable) {
+      throw QueryCompilationErrors.defaultValueNotConstantError(statementType, 
colName, defaultSQL)
+    }
+
+    // Another extra check, expressions should already be resolved if 
AnalysisException is not
+    // thrown in the code block above
+    if (!analyzed.resolved) {
+      throw QueryCompilationErrors.defaultValuesUnresolvedExprError(

Review Comment:
   - https://github.com/apache/spark/actions/runs/9535478067/job/26281266890:
   ```
   [error] 
/home/runner/work/spark/spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ResolveDefaultColumnsUtil.scala:299:36:
 value defaultValueNotConstantError is not a member of object 
org.apache.spark.sql.errors.QueryCompilationErrors
   [error]       throw 
QueryCompilationErrors.defaultValueNotConstantError(statementType, colName, 
defaultSQL)
   [error]                         
   ```
   @urosstan-db @cloud-fan Seems that branch-3.5 does not have the 
`QueryCompilationErrors.defaultValuesUnresolvedExprError` method, which caused 
the branch-3.5 daily build to fail.
   
   



-- 
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

Reply via email to