dejankrak-db commented on code in PR #56238:
URL: https://github.com/apache/spark/pull/56238#discussion_r3337896851


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TableOutputResolver.scala:
##########
@@ -327,7 +327,25 @@ object TableOutputResolver extends SQLConfHelper with 
Logging {
             tableName, newColPath.quoted
           )
         }
-        Some(applyColumnMetadata(defaultExpr.get, expectedCol))
+        // Apply CHAR/VARCHAR length check to the default expression so that 
non-foldable

Review Comment:
   Extracted a shared `applyDefaultWithLengthCheck(defaultExpr, expectedCol, 
conf)` helper, called from both default-fill sites — `reorderColumnsByName` 
(by-name) and `resolveColumnsByPosition` (by-position, reached under V2 
schema-evolution RECURSE). Both paths now apply the CHAR/VARCHAR write-side 
length check identically. Thanks!



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