Skip to content

Instantly share code, notes, and snippets.

@everly-gif
Last active March 31, 2023 11:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everly-gif/b2df9b5b2133afc671c38c43c08f2569 to your computer and use it in GitHub Desktop.
Save everly-gif/b2df9b5b2133afc671c38c43c08f2569 to your computer and use it in GitHub Desktop.
Final report of my work at the Apache Software Foundation for Google Summer of Code 2022


gsoc banner

GSoC 2022 - Final Project Report

The following report summarizes my work done during Google Summer of Code 2022 with the Apache Software Foundation.

Contributor Details

About the Project

ShardingSphere logo

The ecosystem to transform any database into a distributed database system.


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 database fragmentation. ShardingSphere parser engine is the core of ShardingSphere, It 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. However, there are still many statements under these dialects that are not supported yet.

Therefore this project proposes to Solve unsupported Postgres sql about ALTER statements for ShardingSphere Parser and also proofread and optimize the grammar wherever needed.

More details: https://shardingsphere.apache.org/document/current/en/reference/sharding/parse/

Goals

Implementation of properly written and optimized grammar, visit methods, new corresponding SQL cases, and proper support for PostgreSQL ALTER Statements ensuring there are no exceptions in SQL Parsing for the following statements.

ALTER OPERATOR ALTER SERVER
ALTER POLICY ALTER STATISTICS
ALTER PUBLICATION ALTER SUBSCRIPTION
ALTER ROUTINE ALTER TABLE
ALTER RULE ALTER TEXT SEARCH
ALTER SCHEMA ALTER TRIGGER
ALTER SEQUENCE ALTER TYPE
ALTER VIEW

Approach and Workflow

workflow

Background: SQL Parsing


Pull Requests and Issues

Community Bonding period

Includes Community Issues and PRs.

  • #17736: Support ShardingSphere parser of openGauss sql
  • #17856: Support parsing ALTER SYNONYM in openGauss
  • #17861: Support parsing CREATE SYNONYM in openGauss
  • #17862: Support parsing DROP SYNONYM in openGauss
  • #17911: Support parsing CREATE DIRECTORY in openGauss
  • #17960: Support parsing ALTER DIRECTORY in openGauss
  • #17974: Support parsing DROP DIRECTORY in openGauss
  • #17986: Support parsing CREATE CAST in openGauss
  • #18003: Support parsing DROP CAST in openGauss
  • #18032: Support parsing ALTER RULE in openGauss
  • #18034: Support parsing DROP RULE in openGauss
  • #18038: Support parsing CHECKPOINT in openGauss
  • #18086: Support parsing ALTER TYPE in openGauss
  • #18088: Support parsing DROP TYPE in openGauss
  • #18163: Support parsing CREATE PUBLICATION in openGauss
  • #18172: Support parsing DROP PUBLICATION in openGauss

Coding Period

Includes PRs and Issues related to GSoC project

  • #17848: [ GSoC 2022 ] Solve unsupported Postgres sql about ALTER statement for ShardingSphere Parser
  • #18322: Support parsing ALTER OPERATOR in PostgreSQL
  • #18371: Support Parsing ALTER POLICY in PostgreSQL
  • #18427: Support Parsing ALTER PUBLICATION in PostgreSQL
  • #18607: Support Parsing ALTER ROUTINE in PostgreSQL
  • #18784: Support Parsing ALTER RULE in PostgreSQL
  • #19291: Proofread ALTER SEQUENCE grammar + add test cases
  • #19311: Add testcase to support parsing of ALTER SCHEMA in PostgreSQL
  • #19395: Support parsing ALTER SERVER in PostgreSQL
  • #19842: Support parsing ALTER STATISTICS in PostgreSQL
  • #19932: Support Parsing ALTER SUBSCRIPTION in PostgreSQL
  • #20333: Support parsing ALTER TEXT SEARCH in PostgreSQL
  • #20611: Support Parsing ALTER TRIGGER in PostgreSQL
  • #20618: Support Parsing ALTER TYPE in PostgreSQL
  • #20774: Enhance support for ALTER TABLE and ALTER VIEW in PostgreSQL

Result

Intended Goals were met during the standard coding period, SQL parsing for the statements were achieved.

Future Scope

Now that the SQL parsing of these statements are completed, we can focus on configuring read-write splitting feature and implementing the executions of the Parsed SQL.

Acknowledgement

The past 3 months have challenged me to learn and grow. I had a fruitful summer coding and interacting with the Apache ShardingSphere community. This truly has been one of a kind experience. I would like to show my gratitude to my amazing mentors for guiding me throughout this journey and Google for organizing such a beneficial program.

Additional Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment