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

   Index column lists generally allow for more flexibility than just column 
names: i.e. `ASC`/`DESC` modifiers, Postgres opclasses, MySQL column prefix 
length, and generic expressions/"functional key parts".
   
   This change uses the existing support for these constructs added in #1707 
for `CREATE INDEX` and changes the AST for `ALTER TABLE <table> ADD KEY` (and 
associated variants), and constraints present in `CREATE TABLE` statements to 
support these constructs in those location.
   
   Note that, as was already the case with existing `CREATE INDEX` support, 
there is no special representation for MySQL column prefix length (`INDEX 
(textcol(10))`), nor do we require the enclosing parentheses for MySQL 
functional key parts (`INDEX ((col1 + col2))`; for Postgres, this is optional 
if it doesn't introduce ambiguity). Instead, these are parsed generically as 
expressions, so the former is parsed as a function call and the latter is 
wrapped in `Expr::Nested`.
   
   Also note that, as far as I can tell, no dialect supports these more general 
column expressions in the case of `FOREIGN KEY` constraints, so the parsing and 
AST for foreign keys are left unchanged.


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to