You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FlyingZC (via GitHub)" <gi...@apache.org> on 2023/07/13 06:30:01 UTC

[GitHub] [shardingsphere] FlyingZC opened a new issue, #27080: Support parsing Oracle CREATE OR sql

FlyingZC opened a new issue, #27080:
URL: https://github.com/apache/shardingsphere/issues/27080

   # Background
   Hi community,
   This issue is for #26878.
   
   ShardingSphere parser engine helps users parse a SQL to get the AST (Abstract Syntax Tree) and visit this tree to get SQLStatement (Java Object). Currently, we are planning to enhance the support for Oracle SQL parsing in ShardingSphere.
   
   More details:
   https://shardingsphere.apache.org/document/current/en/reference/sharding/parse/
   
   # Task
   This issue is to support more oracle sql parse, as follows:
   ```sql
   CREATE OR REPLACE VIEW sales_view_ref AS
     SELECT country_name country,
            prod_name prod,
            calendar_year year,
            SUM(amount_sold) sale,
            COUNT(amount_sold) cnt
       FROM sales,times,customers,countries,products
       WHERE sales.time_id = times.time_id
         AND sales.prod_id = products.prod_id
         AND sales.cust_id = customers.cust_id
         AND customers.country_id = countries.country_id
         AND ( customers.country_id = 52779
               OR customers.country_id = 52776 )
         AND ( prod_name = 'Standard Mouse'
               OR prod_name = 'Mouse Pad' )
       GROUP BY country_name,prod_name,calendar_year;
   
   SELECT country, prod, year, sale
     FROM sales_view_ref
     ORDER BY country, prod, year;
   ```
   
   ```sql
   CREATE PROFILE new_profile
     LIMIT PASSWORD_REUSE_MAX 10
           PASSWORD_REUSE_TIME 30;
   ```
   
   ```sql
   CREATE PROFILE clerk LIMIT
       SESSIONS_PER_USER 1
       IDLE_TIME 30
       CONNECT_TIME 600;
   
   CREATE USER jfee
       IDENTIFIED BY password
       DEFAULT TABLESPACE users
       TEMPORARY TABLESPACE temp_ts
       QUOTA 500K ON users
       PROFILE clerk;
   
   CREATE USER dcranney
       IDENTIFIED BY password
       DEFAULT TABLESPACE users
       TEMPORARY TABLESPACE temp_ts
       QUOTA unlimited ON users;
   
   CREATE USER userscott
        IDENTIFIED BY password;
   ```
   
   ```sql
   CREATE PROFILE prof LIMIT
    FAILED_LOGIN_ATTEMPTS 10
    PASSWORD_LOCK_TIME 30;
   ALTER USER johndoe PROFILE prof;
   ```
   
   ```sql
   CREATE PROFILE app_user2 LIMIT
      FAILED_LOGIN_ATTEMPTS 5
      PASSWORD_LIFE_TIME 60
      PASSWORD_REUSE_TIME 60
      PASSWORD_REUSE_MAX 5
      PASSWORD_VERIFY_FUNCTION verify_function
      PASSWORD_LOCK_TIME 1/24
      PASSWORD_GRACE_TIME 10;
   ```
   
   # Process
   1. First confirm that this is a correct oracle sql syntax, if not please ignore;
   2. Compare SQL definitions in Oficial SQL Doc and ShardingSphere SQL Doc;
   3. If there is any difference in ShardingSphere SQL Doc, please correct them by referring to the Official SQL Doc;
   4. Run mvn install the current_file_module;
   5. Check whether there are any exceptions. If indeed, please fix them. (Especially xxxVisitor.class);
   6. Add new corresponding SQL case in SQL Cases and expected parsed result in Expected Statment XML;
   7. Run SQLParserParameterizedTest to make sure no exceptions.
   
   # Relevant Skills
   1. Master JAVA language
   2. Have a basic understanding of Antlr `g4` file
   3. Be familiar with Oracle SQLs


-- 
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.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on issue #27080: Support parsing Oracle CREATE OR sql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742463522

   > > > Hi, is there anyone in the community currently working on this issue?
   > > 
   > > 
   > > No, do you want to finish this task?
   > 
   > I think this pr: #28432 has finished the task.
   
   Can you test these sqls? If all sqls have been supported, I will close this issue.


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


Re: [I] Support parsing Oracle CREATE OR sql [shardingsphere]

Posted by "lancelly (via GitHub)" <gi...@apache.org>.
lancelly commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742566557

   > > > > Hi, is there anyone in the community currently working on this issue?
   > > > 
   > > > 
   > > > No, do you want to finish this task?
   > > 
   > > 
   > > I think this pr: #28432 has finished the task.
   > 
   > Can you test these sqls? If all sqls have been supported, I will close this issue.
   
   Not all SQLs are supported, I only tested the sql of create view as I need it.


-- 
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] github-actions[bot] commented on issue #27080: Support parsing Oracle CREATE OR sql

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1676080800

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
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 issue #27080: Support parsing Oracle CREATE OR sql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742461786

   @


-- 
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] lancelly commented on issue #27080: Support parsing Oracle CREATE OR sql

Posted by "lancelly (via GitHub)" <gi...@apache.org>.
lancelly commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742347274

   Hi, is there anyone  in the community currently working on this issue?


-- 
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] lancelly commented on issue #27080: Support parsing Oracle CREATE OR sql

Posted by "lancelly (via GitHub)" <gi...@apache.org>.
lancelly commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742405892

   > > Hi, is there anyone in the community currently working on this issue?
   > 
   > No, do you want to finish this task?
   
   I think this pr: https://github.com/apache/shardingsphere/pull/28432 has finished the task.


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


Re: [I] Support parsing Oracle CREATE OR sql [shardingsphere]

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1745990275

   If you are interested, you can try to finish this issue.


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


Re: [I] Support parsing Oracle CREATE OR sql [shardingsphere]

Posted by "Yash-cor (via GitHub)" <gi...@apache.org>.
Yash-cor commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-2449151346

   Hello @strongduanmu these oracle queries are being parsed correctly 
   
   Example :
   CREATE PROFILE app_user2 LIMIT
      FAILED_LOGIN_ATTEMPTS 5
      PASSWORD_LIFE_TIME 60
      PASSWORD_REUSE_TIME 60
      PASSWORD_REUSE_MAX 5
      PASSWORD_VERIFY_FUNCTION verify_function
      PASSWORD_LOCK_TIME 1/24
      PASSWORD_GRACE_TIME 10;
      
      
   ![parseTree](https://github.com/user-attachments/assets/ba47db36-57a7-46fe-a849-0257fd64d05e)
   
   
   Also I will add these test cases to tests -> it -> parsers -> resources -> sql. for Oracle SQL
   


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


Re: [I] Support parsing Oracle CREATE OR sql [shardingsphere]

Posted by "Yash-cor (via GitHub)" <gi...@apache.org>.
Yash-cor commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-2449170472

   Could you please assign me with this issue.
   
   > Hello @strongduanmu these oracle queries are being parsed correctly
   > 
   > Example : CREATE PROFILE app_user2 LIMIT FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LIFE_TIME 60 PASSWORD_REUSE_TIME 60 PASSWORD_REUSE_MAX 5 PASSWORD_VERIFY_FUNCTION verify_function PASSWORD_LOCK_TIME 1/24 PASSWORD_GRACE_TIME 10;
   > 
   > ![parseTree](https://private-user-images.githubusercontent.com/179561629/381852890-ba47db36-57a7-46fe-a849-0257fd64d05e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzAzNTc3NjgsIm5iZiI6MTczMDM1NzQ2OCwicGF0aCI6Ii8xNzk1NjE2MjkvMzgxODUyODkwLWJhNDdkYjM2LTU3YTctNDZmZS1hODQ5LTAyNTdmZDY0ZDA1ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMDMxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTAzMVQwNjUxMDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYmQxMDYxM2Q0NzRmZmFiYmUxOTczOTdjODcyMmUxYjA0OGYyZTY5NDMzOGU1ZTUxYTY1OTE3MDM1MTE0ZmRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.c98lWWjSONLNfY46lCY3PfJ8LNhqRd_9r3_ZGmX0dh0)
   > 
   > Also I will add these test cases to tests -> it -> parsers -> resources -> sql. for Oracle SQL
   
   Could you please assign me with this issue


-- 
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 issue #27080: Support parsing Oracle CREATE OR sql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1742403347

   > Hi, is there anyone in the community currently working on this issue?
   
   No, do you want to finish this task?


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


Re: [I] Support parsing Oracle CREATE OR sql [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27080:
URL: https://github.com/apache/shardingsphere/issues/27080#issuecomment-1793031634

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


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