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

   ### What changes were proposed in this pull request?
   
   Decode persisted `EXISTS_DEFAULT` string literals using the escaping 
produced by `Literal.sql`, independently of 
`spark.sql.parser.escapedStringLiterals`. Use an isolated parser configuration 
so executor readers do not mutate their SQL configuration, and resolve collated 
literals without reparsing their contents. Preserve the existing session-based 
fallback for unresolved catalog expressions.
   
   ### Why are the changes needed?
   
   After `ALTER TABLE ADD COLUMN ... STRING DEFAULT`, old rows receive a 
default reconstructed from SQL metadata. With `escapedStringLiterals=true`, 
readers preserve the serialization escapes, so old rows can contain extra 
backslashes while new rows receive the original default.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Existing rows now receive the original string default, including 
backslashes and quotes, under either string-literal parser mode.
   
   ### How was this patch tested?
   
   Added regression coverage in `StructTypeSuite` for plain and collated 
strings, schema JSON persistence, both parser modes, and unresolved-expression 
fallback. The new legacy-mode regression failed before the production change; 
all 47 tests in the suite pass after the fix.
   
   Added a Parquet regression in `InsertSuite` comparing old rows with explicit 
`DEFAULT` inserts across creation/read parser modes and 
vectorized/nonvectorized readers. All 92 tests in `InsertSuite` passed, 
including the surrounding default-column tests. Scala style checks passed for 
production and test sources in both changed modules.
   
   ### 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