question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support ShardingSphere parser of openGauss sql

See original GitHub issue

Hi, I think we can support parsing more SQLs for openGauss(version 3.0.0).

Background

How is a SQL parsed? SQL definition file ->(Parse to) AST ->(Visit it) SQLStatment

Process

  1. Compare SQL definitions in Oficial SQL Doc and ShardingSphere SQL Doc
  2. If there is any difference in ShardingSphere SQL Doc, please correct them referring to Official SQL Doc
  3. Run mvn install the current_file_module
  4. Check whether there are any exceptions. If indeed, please fix them. (Especially xxxVisitor.class)
  5. Add new corresponding SQL case in SQL Cases and expected parsed result in Expected Statment XML
  6. Run SQLParserParameterizedTest to make sure no exceptions.

Notice

  1. Left recursion can not work well in Antlr4,
a
  : b
  | a b
  ;
b
  : a c
  ;
c
  : ...
  ;

you can consider the following one,

a
  : b*
  ;
b
  : a c
  ;
c
  : ...
  ;
  1. Here is a Chinese version for reference.

Subtask

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rajmunkhancommented, Jun 7, 2022

I want to start working on

  • CREATE AGGREGATE
1reaction
rajmunkhancommented, Jun 7, 2022

Hey @strongduanmu, I also want to contribute to this task, can u also assign this to me? 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

openGauss - Apache ShardingSphere
SQL. CREATE type avg_state AS (total bigint, count bigint);. CREATE AGGREGATE my_avg(int4) (stype = avg_state, sfunc = avg_transfn, finalfunc = avg_finalfn).
Read more >
SQL Parser - Apache ShardingSphere
It supports SQL dialect for MySQL, PostgreSQL, SQLServer, Oracle, openGauss and SQL that conform to the SQL92 specification. However, due to the complexity ......
Read more >
SQL Parser - Apache ShardingSphere
Implementation classes ; SQL92, SQL parser entry based on SQL92, org.apache.shardingsphere.sql.parser.sql92.parser.SQL92ParserFacade ; openGauss, SQL parser entry ...
Read more >
SQL Parser - Apache ShardingSphere
OracleParserFacade, SQL parser facade for Oracle. SQL92ParserFacade, SQL parser facade for SQL92. OpenGaussParserFacade, SQL parser facade for openGauss ...
Read more >
SQL Parser - Apache ShardingSphere
sqlStatementCache (?), CacheOption, sql statement local cache configuration. Cache option Configuration. Class:org.apache.shardingsphere.sql.parser.api.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found