yuqi1129 opened a new issue, #14631:
URL: https://github.com/apache/gravitino/issues/14631

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   JDBC table DDL has three related correctness problems:
   
   - The shared default converter renders function arguments using Java object 
descriptions and accepts SQL syntax in function names. PostgreSQL also accepts 
arbitrary ExternalType fragments rather than a single type declaration. 
Backslashes in string defaults depend on standard_conforming_strings.
   - ALTER add-column and set-default requests retain literal DTOs instead of 
converting them as CREATE does. Explicit NULL defaults can become the string 
'NULL' or fail conversion; omitted defaults and the string literal "NULL" must 
keep their distinct meanings.
   - PostgreSQL reports standalone unique indexes as UNIQUE_KEY indexes, but 
deletes them using DROP CONSTRAINT. With ifExists=true this can return success 
while leaving the index in place.
   
   ### Error message and/or stacktrace
   
   A function default such as abs(-3) produces abs(LiteralImpl{...}) and a 
source syntax error. An external type such as `integer, extra integer` can add 
an unrequested column. Deleting a standalone unique index can report a missing 
constraint or silently do nothing.
   
   ### How to reproduce
   
   1. Create or alter a PostgreSQL column using an ExternalType with an extra 
column declaration, or a function default with SQL punctuation in its name. 
Compare with a valid function containing a literal argument.
   2. Send ALTER add-column or set-default requests containing a NULL literal, 
including a typed literal whose value is null, and insert a row using its 
defaults.
   3. Create a native standalone unique index, load the table, then delete that 
index through the table index API with ifExists=true. Reload the table and 
observe that the index remains.
   
   ### Additional context
   
   Validate DDL fragments and render supported expressions safely; normalize 
ALTER default DTOs consistently with CREATE. For standalone unique indexes, an 
explicit unsupported-operation error is sufficient for this fix. 
Constraint-backed index deletion should continue to work.
   


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