jonahgao opened a new pull request, #7263:
URL: https://github.com/apache/arrow-datafusion/pull/7263

   ## Which issue does this PR close?
   Partially #7255
   
   datafusion-cli currently only supports the generic dialect.
   For example: 
   ```
   DataFusion CLI v28.0.0
   ❯ set datafusion.sql_parser.dialect = postgresql;
   0 rows in set. Query took 0.003 seconds.
   
   ❯ select 17 # 5;  🤔 Invalid statement: sql parser error: No infix parser for 
token Sharp
   ```
   `select 17 # 5` is valid in the PostgreSQL dialect, but got an ‘Invalid 
statement’ error.
   
   This is because the rustyline validator only supports the generic dialect, 
not the one specified by the current user.
   
https://github.com/apache/arrow-datafusion/blob/bb185a64d1ec14eb3f6c638147d382a2a0fcf4dd/datafusion-cli/src/helper.rs#L53
   
   
   ## Rationale for this change
   - rustyline validator takes into consideration the current user’s dialect 
setting. 
   - After SQL statement execution is completed, attempt to synchronize the 
validator’s dialect.
   
   
   ## What changes are included in this PR?
   CLI support different sql dialects.
   
   ## Are these changes tested?
   Yes
   
   ## Are there any user-facing changes?
   No
   
   


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