You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "kanha-gupta (via GitHub)" <gi...@apache.org> on 2023/04/03 04:24:42 UTC

[GitHub] [shardingsphere] kanha-gupta opened a new pull request, #24970: support for select substring

kanha-gupta opened a new pull request, #24970:
URL: https://github.com/apache/shardingsphere/pull/24970

   @strongduanmu Hello, while adding support for SQL's having identifiers, Numbers & Symbols I have came across a problem.
   In the following code, I have debugged MySQLStatementSQLVisitor.java & the result of method VisitSubstringFunction have the required Parameters/OperandList. But the same do not shows up in SQLNodeConverterEngineIT.java ACTUAL parsing while running.
   Can you please guide me regarding what I am doing wrong in parsing these type of queries ?
   Thank you 
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on pull request #24970: support for select substring

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1499796053

   And `SELECT SUBSTRING('foobarbar' FROM 4)`, you can refer this result. You just need to extract the function name and constants as arguments to the outer function.
   
   <img width="595" alt="image" src="https://user-images.githubusercontent.com/10829171/230517992-66f1f940-6ab8-4570-a27c-b76653fdaeb0.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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] kanha-gupta commented on pull request #24970: support for select substring

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1499321994

   @strongduanmu Hello, I request you to review the code.
   Actual parsing of Select_extract gives "SELECT EXTRACT(YEAR() FROM '2019-07-02') "
   How to deal with parenthesis after YEAR keyword ? 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] kanha-gupta commented on pull request #24970: support for select substring

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1500891656

   @strongduanmu Hello
   for sql query "SELECT EXTRACT(YEAR FROM '2019-07-02')"
   I tried many ways but I cant exactly figure out how to just get the word "YEAR" instead of "YEAR()". Extracting FunctionName is giving errors on my machine therefore Please suggest the approach.
   Thank you 
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] kanha-gupta closed pull request #24970: support for select substring

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta closed pull request #24970: support for select substring
URL: https://github.com/apache/shardingsphere/pull/24970


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on pull request #24970: support for select substring

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1499791752

   > @strongduanmu Hello, I request you to review the code. Actual parsing of Select_extract gives "SELECT EXTRACT(YEAR() FROM '2019-07-02') " How to deal with parenthesis after YEAR keyword ?
   
   Hi @kanha-gupta, can you show the result we expected in Calcite?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] kanha-gupta commented on pull request #24970: support for select substring

Posted by "kanha-gupta (via GitHub)" <gi...@apache.org>.
kanha-gupta commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1501060512

   @strongduanmu Thanks a lot for guidance.
   select_substring task is done.  2 more doubts :
   1- for select_trim, There is a symbol BOTH which needs to parsed, I tried doing it using Expression segment & also LiteralExpressionSegment but it is being Parsed as String instead of Symbol therefore it results in "BOTH" instead of BOTH.
   2 - for select_extract, YEAR is a function & Extracting only FunctionName leads to Errors & parsing it as a function leads to parenthesis ( YEAR() )
   I request you to please provide your guidance regarding this Because rest of the 5 special function tasks have these type of parsing.
   Thank you 
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on pull request #24970: support for select substring

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #24970:
URL: https://github.com/apache/shardingsphere/pull/24970#issuecomment-1499794937

   You can refer calcite parse result for `SELECT SUBSTRING('foobarbar' FROM 4)` sql.
   
   <img width="671" alt="image" src="https://user-images.githubusercontent.com/10829171/230517816-510e7915-7009-434e-b8ed-14d09ceab24c.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: notifications-unsubscribe@shardingsphere.apache.org

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