You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/10 20:25:09 UTC

[GitHub] [arrow-datafusion] ovr opened a new pull request, #2195: fix: Use PostgreSQL dialect for parsing

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

   Hello!
   
   SQLParser library which is used for parsing has hacks for dialect:
   
   https://github.com/sqlparser-rs/sqlparser-rs/blob/bfd416d9785acc5d75f811cf0240c18d999a1d38/src/parser.rs#L647
   
   I want to implement support for ArrayIndex, but it's not possible with `GenericDialect`. DF uses PostgresSQL as a base for implementing functions/information_schema/etc. I would like to suggest using the PostgreSQL dialect for parsing instead of implementing our own dialect and changing SQLParser.
   
   Thanks


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1214137938

   I think we have decided to make the Generic dialect more generic in sqlparser rather than switch DataFusion to use Postgres dialect. Perhaps this PR can be closed 


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1100180991

   Marking as draft to make it clear this PR isn't waiting on review -- please feel free to mark it as ready for review if that analysis is not correct or if it is ready to review again


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] ovr commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
ovr commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1094364654

   Hmm, Interesting. DF has a test that uses MySQL like dialect.
   
   <img width="1064" alt="image" src="https://user-images.githubusercontent.com/572096/162638860-dcb95fce-4b4d-413f-a2ff-b98576348d10.png">
   


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] ovr closed pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
ovr closed pull request #2195: fix: Use PostgreSQL dialect for parsing
URL: https://github.com/apache/arrow-datafusion/pull/2195


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] houqp commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
houqp commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1095892657

   yeah, i think we would need to either maintain our own posgresql superset dialect or switch to functions like `current_setting` (https://www.postgresql.org/docs/9.3/functions-admin.html).


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1096599374

   I tried quickly making some changes in sqlparser-rs like this:
   
   ```diff
   -        if dialect_of!(self is PostgreSqlDialect) {
   +        if dialect_of!(self is PostgreSqlDialect | GenericDialect) {
   ```
   
   And it seemed to go well. What do you think @ovr ?  would that be a reasonable approach? I can try to make a new release of sqlparser later this week to get it through. 


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1096591740

   Another other alternative is to remove the `is postgres` check from sqlparser -- there are many examples in sqlparser-rs of postgres specific syntax that is not gated by the postgres dialect flag


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] ovr commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
ovr commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1100264646

   Hello @alamb ,
   
   I am still thinking about the solution because right now I am working on the Cube SQL project which works as a proxy. It supports MySQL & PostgreSQL dialects at the same time. I am thinking about allowing passing dialect to Sql2Rel, WDYT?
   
   Thanks


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] alamb commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1100648067

   > I am still thinking about the solution because right now I am working on the Cube SQL project which works as a proxy. It supports MySQL & PostgreSQL dialects at the same time. I am thinking about allowing passing dialect to Sql2Rel, WDYT?
   
   👍 
   
   I think passing the dialect seems like a reasonable thing to try. As long as the plumbing doesn't get too messy it might work quite well


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] ovr commented on pull request #2195: fix: Use PostgreSQL dialect for parsing

Posted by GitBox <gi...@apache.org>.
ovr commented on PR #2195:
URL: https://github.com/apache/arrow-datafusion/pull/2195#issuecomment-1214953068

   > I think we have decided to make the Generic dialect more generic in sqlparser rather than switch DataFusion to use Postgres dialect. Perhaps this PR can be closed
   
   Sure, Let's close this PR.


-- 
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-unsubscribe@arrow.apache.org

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