mihaibudiu opened a new pull request, #3698:
URL: https://github.com/apache/calcite/pull/3698

   This modifies the parser to accept types such as INTEGER NOT NULL ARRAY NULL 
for column types.
   The only thing I don't like too much about this PR is the fact that this 
type is unparsed differently depending on where it appears: - - in a column 
definition it is unparsed as INTEGER NOT NULL ARRAY
   - in a CAST it is unparsed as INTEGER ARRAY (the type can appear in a cast 
due to type coercion, so this is a legal use case)
   
   These two not the same type at all, but other databases, such as Postgres, 
also do not accept types with nullabilities in casts. Maybe that's a bug in 
Postgres as well, or maybe in the SQL handling of collection types in general? 
   
   In order to provide this behavior I had to add some state to the SqlWriter 
which indicates the context where a type is being unparsed. Fortunately, types 
cannot contain other kinds of SqlNodes - e.g., expressions - so a stack of 
context is not necessary, a scalar will do.
   
   


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