hutiefang76 opened a new issue, #4423:
URL: https://github.com/apache/amoro/issues/4423

   ### What happened?
   
   Property names/values and column comments are interpolated directly between 
single quotes. Apostrophes can produce invalid Spark SQL, and backslashes can 
change the interpreted value. Removing a comment also records the string `null` 
instead of an empty comment.
   
   ### Affects Versions
   
   master at 061eb724e93592fe87cf44b61af34c1d799f5db6 (0.9-SNAPSHOT). No claim 
about untested releases.
   
   ### What table formats are you seeing the problem on?
   
   Shared Spark DDL generation for descriptor history.
   
   ### What engines are you seeing the problem on?
   
   AMS table-operation history, using the Spark DDL formatter.
   
   ### How to reproduce
   
   Call `new 
SparkMetadataChangeHandler("tbl").changeAndAddProperties(Collections.singletonMap("author",
 "O'Reilly"))`.
   
   Actual: `ALTER TABLE tbl SET TBLPROPERTIES ('author' = 'O'Reilly')`.
   Expected: a valid Spark string literal that preserves `O'Reilly` when parsed.
   
   Also call `changeColumnsComment("c", null)`: expected `COMMENT ''`, rather 
than `COMMENT 'null'`. Include a property value containing a literal backslash 
to observe Spark's escape interpretation.
   
   ### Relevant log output
   
   This is a deterministic metadata/DDL conversion error, reproduced without a 
running cluster. The before/expected values are shown above.
   
   ### Anything else
   
   Scoped to generated history text under Spark's default string-literal 
parsing. Identifier quoting and non-default parser configurations are outside 
this issue.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR.
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct.
   
   AI assistance: DeepSeek and Codex assisted reproduction, implementation, 
tests and this description.
   


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

Reply via email to