You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/12/13 20:08:40 UTC

[GitHub] [pinot] kriti-sc edited a comment on pull request #7894: #7714 ignore query options in commented out queries

kriti-sc edited a comment on pull request #7894:
URL: https://github.com/apache/pinot/pull/7894#issuecomment-992840373


   @Jackie-Jiang carrying review forward from PR: https://github.com/apache/pinot/pull/7869
   
   The way I have resolved [the issue you have mentioned](https://github.com/apache/pinot/pull/7869#discussion_r763295703): I am using `-{2,}` pattern (SQL query comment pattern) as signposts to remove query options found in the commented-out portion of the query.
   
   This will not work for queries which have query options specified and are using the `-{2,}` pattern in string literals & identifiers. For ex.
   ```
   SELECT * FROM tablex WHERE cola LIKE '%---%' OPTION (a=b)
   ```
   will be parsed as
   ```
   SELECT * FROM tablex WHERE cola LIKE '%---%'
   ```
   This can be mitigated by differentiating regex pattern between query comment and string literal/identifier.
   
   I did check if we could use the default MySQL dialect to pass query options (using `SET`) – this does not seem to be supported by Calcite. For example, the following query threw a Calcite parsing error:
   ```
   SET session.timeoutMs="X" 
   
   SELECT * FROM baseballStats
   ```
   Please let me know if I am missing something here ^^


-- 
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: commits-unsubscribe@pinot.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org