yuqi1129 opened a new pull request, #14632:
URL: https://github.com/apache/gravitino/pull/14632

   ### What changes were proposed in this pull request?
   
   - Validate JDBC default function identifiers and render 
literal/nested-function arguments through the dialect converter. Restrict 
PostgreSQL ExternalType writes to single type declarations, and use explicit 
escape literals for strings containing backslashes.
   - Convert add-column and set-default request DTOs to canonical expressions, 
matching CREATE. Preserve SQL NULL, the string "NULL", and omitted defaults as 
distinct values.
   - Detect PostgreSQL standalone unique indexes using table-scoped, 
parameterized metadata lookup. Reject both strict and ifExists deletion 
requests before applying DDL; retain constraint-backed index deletion.
   - Add regression tests and document the supported write syntax and 
standalone-index limitation.
   
   ### Why are the changes needed?
   
   Unvalidated fragments can change the requested DDL, valid function arguments 
are rendered incorrectly, and ALTER NULL defaults do not follow CREATE 
semantics. Standalone index deletion can also return success without removing 
the index. These are bounded fixes to JDBC table DDL.
   
   Fixes #14631
   
   ### Does this PR introduce _any_ user-facing change?
   
   Unsafe or unsupported write syntax fails before DDL. Supported function 
defaults render correctly, string escaping is independent of 
standard_conforming_strings, and ALTER NULL defaults use SQL NULL. Standalone 
unique-index deletion now fails explicitly, including ifExists requests; direct 
PostgreSQL removal remains necessary. No new API, dependencies, or metadata 
migrations.
   
   ### How was this patch tested?
   
   - Common, JDBC common, and PostgreSQL module tests with Docker enabled: 784, 
143, and 165 cases respectively; zero failures, one existing common-module skip.
   - PostgreSQL table/schema fixtures tested on PostgreSQL 13 and 16. All 165 
PostgreSQL module cases passed on each run; the separate data-source fixture 
stayed on PostgreSQL 13. The default fixture image is unchanged in this patch.
   - Live regressions cover rejected CREATE/ALTER fragments without side 
effects, valid native types and function defaults, both string settings, ALTER 
NULL defaults followed by source INSERT, and explicit standalone-index refusal 
without applying earlier changes in the request.
   - New NULL/default and standalone-index regressions fail against the 
original implementation. Existing constraint-index lifecycle tests continue to 
pass.
   - Module Spotless checks and git diff checks passed. Full server 
REST/Spark/Trino end-to-end tests were not run.
   


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