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

   ### Describe the feature
   
   Support optional character set (`charset`) and collation metadata in 
Gravitino's character types, including `char`, `varchar`, and `string`, and 
preserve these attributes when loading and creating tables.
   
   ### Motivation
   
   Gravitino's character types currently cannot represent charset or collation. 
For example, mapping SQL Server `VARCHAR(100)` and `NVARCHAR(100)` to the same 
`varchar(100)` loses the source character-type distinction. Recreating a table 
from that metadata can change its character representation. Losing collation 
can also change comparison and sorting behavior.
   
   Using `ExternalType` can preserve a native type spelling, but does not 
provide structured character metadata that connectors and engine integrations 
can consistently consume. This requires support in the shared type system.
   
   ### Describe the solution
   
   - Add optional charset and collation attributes to character types, 
preserving existing behavior when these attributes are absent.
   - Preserve the attributes through type parsing, serialization, REST APIs, 
Java/Python clients, and type equality/hash semantics.
   - Update supported JDBC connectors to read the source attributes and use 
them when generating CREATE/ALTER DDL, preserving native character-type 
distinctions such as `VARCHAR` versus `NVARCHAR` where applicable.
   - Define backend-specific naming, defaults, and length semantics; avoid 
treating byte lengths, character lengths, and UTF-16 code units as 
interchangeable.
   - Update engine integrations to handle these attributes explicitly, and add 
round-trip tests for charset/collation preservation and compatibility with 
existing type representations.
   
   ### Additional context
   
   SQL Server national character types and MySQL columns with explicit 
character sets/collations are motivating cases. The API design should support 
these cases without requiring an external type for otherwise supported 
character types.
   


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