yyanyy opened a new pull request, #59819:
URL: https://github.com/apache/spark/pull/59819

   ### What changes were proposed in this pull request?
   
   Preserve current-time expressions when resolving column defaults for writes 
so the enclosing query evaluates them together with explicit current-time 
expressions. Keep eager default validation, type coercion, and 
existence-default materialization.
   
   ### Why are the changes needed?
   
   Each default currently runs its own finish-analysis pass and captures a 
separate instant. For example, inserting `DEFAULT, DEFAULT, 
current_timestamp()` into two timestamp default columns and an explicit 
timestamp column can store three different timestamps in one row.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Current-time column defaults now use the same query instant as explicit 
current-time expressions, including across multiple defaults and inserted rows.
   
   ### How was this patch tested?
   
   Added deterministic fixed-instant coverage for current_timestamp, now, 
current_date, localtimestamp, nanosecond timestamp variants, nested 
expressions, and implicit coercions. Added SQL coverage for explicit DEFAULT 
and omitted columns in multi-row VALUES and INSERT SELECT statements. Both 
regression tests failed before the production change; all 22 
ResolveDefaultColumnsSuite tests pass with the fix.
   
   Also passed: 133 tests across ComputeCurrentTimeSuite and 
InMemorySessionCatalogSuite, 10 INSERT default tests, and Catalyst 
production/SQL test Scala style checks.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex (GPT-6)
   


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