The following report summarizes my work done during Google Summer of Code 2022 with the Apache Software Foundation.
- Name: Everly Precia Suresh
- Github Username: everly-gif
- Organization: The Apache Software Foundation
- Project Title: Solve unsupported Postgres SQL about alter statement for ShardingSphere Parser
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.
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 |
- Proofread through DDLStatement.g4 to analyze existing grammars and optimize them.
- Write grammar for unsupported ALTER Statements referring to the official PostgreSQL documentation.
- Implement visit methods for the statements.
- Add new corresponding SQL cases in SQL Cases and expected parsed results in Expected Statement XML.
- Run SQLParserParameterizedTest and UnsupportedSQLParserParameterizedTest to make sure there are no exceptions.
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
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
andALTER VIEW
in PostgreSQL
Intended Goals were met during the standard coding period, SQL parsing for the statements were achieved.
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.
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.