OceanBase SQL Parser for Java

General SQL Parser (GSP) parses OceanBase with a dedicated, hand-tuned grammar — full AST access, offline syntax validation, formatting, rewriting, and column-level data lineage, including complete procedural SQL support. One commercial SDK — OceanBase is available in the Java edition.

Weekly
release cadence — dialect fixes ship in days

OceanBase SQL that GSP parses

CREATE TABLEGROUP tg_orders
PRIMARY_ZONE = 'zone1',
LOCALITY = 'F@zone1,F@zone2,F@zone3',
BINDING = TRUE
PARTITION BY HASH PARTITIONS 8;

Parse it in Java

import gudusoft.gsqlparser.*;

TGSqlParser parser = new TGSqlParser(EDbVendor.dbvoceanbase);
parser.sqltext = sql; // the OceanBase SQL above
if (parser.parse() == 0) {
    System.out.println(parser.sqlstatements.size() + " statement(s) parsed");
} else {
    System.out.println(parser.getErrormessage());
}

Java edition only. The .NET library has no OceanBase grammar, so this dialect cannot be parsed from C# or VB.NET. See the .NET SQL Parser SDK for the dialects it does cover.

What GSP handles in OceanBase

Beyond parsing, the same AST powers table/column extraction, validation, formatting, and column-level lineage for OceanBase.

Recent OceanBase parser updates

Full history in the release notes.

OceanBase resources

Common questions

Does GSP parse OceanBase stored procedures and procedural SQL?

Yes. GSP parses OceanBase Oracle-mode PL/SQL — packages, anonymous blocks, and PL/SQL routines via a dedicated Oracle-mode parser (MySQL and system tenant modes are SQL-only) into a full AST — procedure bodies become real statement trees you can traverse, not opaque text blocks. This is what makes lineage and impact analysis work inside procedural code.

Do I need a live OceanBase database connection to validate SQL?

No. GSP validates OceanBase syntax completely offline. You get error line and column positions, the offending token, and a hint — with no server, driver, or credentials involved.

Can I use the OceanBase parser from C# / .NET?

Not currently. OceanBase is a Java-edition dialect — the .NET library ships 15 dedicated grammars and OceanBase is not one of them, so there is no C# code path for it. Everything else on this page describes the Java SDK. If you need OceanBase in .NET, email info@sqlparser.com; customer demand is how dialects get prioritized for the .NET port.

Can GSP extract column-level lineage from OceanBase SQL?

Yes. The built-in DataFlowAnalyzer produces column-level lineage, impact analysis, and call graphs from OceanBase scripts — it is the engine behind Gudu SQLFlow and the lineage integrations for DataHub and OpenMetadata.