LucaCappelletti94 opened a new pull request, #2676:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2676

   PostgreSQL lets user-defined types take simple constants or identifiers as 
modifiers (https://www.postgresql.org/docs/current/sql-createtype.html), and 
ClickHouse writes `Object('json')`. `DataType::Custom` stored each modifier as 
a bare `String`, so the quotes were lost on display: `Object('json')` was 
printed as `Object(json)`, `foo('a b')` as `foo(a b)` (parsed back as two 
modifiers), and `foo('it''s')` as `foo(it's)`, which no longer parses.
   
   `DataType::Custom` now holds a `Vec<TypeModifier>`, which keeps identifiers 
(with their quote style), numbers (with the `L` suffix) and single-quoted 
strings apart, and strings are displayed with their quotes escaped. This is a 
public API change for code that builds or matches `DataType::Custom` or calls 
`parse_optional_type_modifiers`. Tests round-trip string, identifier and number 
modifiers in every dialect, and the ClickHouse `Object` test now checks the 
typed modifiers.
   
   This conflicts with #2557, which also builds `DataType::Custom` modifiers, 
so whichever lands second needs a small update.


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