Uploaded image for project: 'Comdev GSOC'
  1. Comdev GSOC
  2. GSOC-210

Apache ShardingSphere: Solve unsupported Postgres sql about statements that start with 'c' for ShardingSphere Parser

    XMLWordPrintableJSON

Details

    Description

      Apache ShardingSphere

      Apache ShardingSphere is positioned as a Database Plus, and aims at building a standard layer and ecosystem above heterogeneous databases. It focuses on how to reuse existing databases and their respective upper layer, rather than creating a new database. The goal is to minimize or eliminate the challenges caused by underlying databases fragmentation.

      Page: https://shardingsphere.apache.org
      Github: https://github.com/apache/shardingsphere 

      Background

      ShardingSphere parser engine helps users parse a SQL to get the AST (Abstract Syntax Tree) and visit this tree to get SQLStatement (Java Object). At present, this parser engine can handle SQLs for `MySQL`, `PostgreSQL`, `SQLServer`, `openGauss` and `Oracle`, which means we have to understand different database dialect SQLs.
       
      More details:
      https://shardingsphere.apache.org/document/current/en/reference/sharding/parse/ 

      Task

      This issue is to solve the unsupported postgres sql about alter in this file . * CALL

      • CHECKPOINT
      • CLOSE
      • CLUSTER
      • COMMENT
      • COPY
      • CREATE ACCESS METHOD
      • CREATE AGGREGATE
      • CREATE CAST
      • CREATE COLLATION
      • CREATE EVENT TRIGGER
      • CREATE FOREIGN DATA WRAPPER
      • CREATE FOREIGN TABLE
      • CREATE GROUP
      • CREATE MATERIALIZED VIEW
      • CREATE OPERATOR
      • CREATE POLICY
      • CREATE PUBLICATION

       
      You can learn more here. *
      You may need to try to get why it's not supported.(antlr4 grammar? or not implement visit method) You can use antlr4 plugins to help you to analyze. You may need to visit an official doc to check the grammar.

       
      Notice, these issues can be a good example.
      support alter foreign table for pg/og
      support alter materialized view for pg/og.

      Relevant Skills

       
      1. Master JAVA language
      2. Have a basic understanding of Antlr g4 file
      3. Be familiar with Postgres SQLs 

      Targets files

       
      1. Postgres SQLs g4 file: https://github.com/apache/shardingsphere/blob/master/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatement.g4

      Mentor

      Zhengqiang Duan, Committer of Apache ShardingSphere, duanzhengqiang@apache.org
      Haoran Meng, PMC of Apache ShardingSphere, menghaoran@apache.org

      Attachments

        Activity

          People

            Unassigned Unassigned
            duanzhengqiang Zhengqiang Duan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: