Apache Doris SQL Parser for Java
General SQL Parser (GSP) parses Apache Doris with a dedicated, hand-tuned grammar — full AST access, offline syntax validation, formatting, rewriting, and column-level data lineage. One commercial SDK — Apache Doris is available in the Java edition.
Apache Doris SQL that GSP parses
CREATE TABLE events (
event_time DATETIME,
event_type INT,
user_id BIGINT,
event_data VARCHAR(1024)
) DUPLICATE KEY(event_time, event_type)
ENGINE=OLAP
DISTRIBUTED BY HASH(user_id) BUCKETS 10; Parse it in Java
import gudusoft.gsqlparser.*;
TGSqlParser parser = new TGSqlParser(EDbVendor.dbvdoris);
parser.sqltext = sql; // the Apache Doris 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 Apache Doris 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 Apache Doris
- CREATE TABLE distribution and data-model clauses
- Partitioning DDL
- Materialized view DDL
- MySQL-compatible query syntax where Doris diverges from stock MySQL
- Doris keywords usable as unquoted identifiers
Beyond parsing, the same AST powers table/column extraction, validation, formatting, and column-level lineage for Apache Doris.
Apache Doris resources
- Apache Doris syntax reference — dialect documentation
- Apache Doris keyword compatibility — every keyword, and whether it can be an identifier
- Apache Doris capability data (JSON) — measured construct-by-construct parse coverage, machine-readable
- Java quick start — Maven/Gradle setup and first parse
Common questions
Do I need a live Apache Doris database connection to validate SQL?
No. GSP validates Apache Doris syntax completely offline. You get error line and column positions, the offending token, and a hint — with no server, driver, or credentials involved.
How complete is the Apache Doris grammar?
GSP uses a dedicated hand-tuned grammar for Apache Doris — not a generic SQL grammar with flags. The parser recognizes 574 Apache Doris keywords and knows which 571 of them can also be used as identifiers, which is exactly the kind of edge case that breaks generic parsers.
Can I use the Apache Doris parser from C# / .NET?
Not currently. Apache Doris is a Java-edition dialect — the .NET library ships 15 dedicated grammars and Apache Doris 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 Apache Doris in .NET, email info@sqlparser.com; customer demand is how dialects get prioritized for the .NET port.
Can GSP extract column-level lineage from Apache Doris SQL?
Yes. The built-in DataFlowAnalyzer produces column-level lineage, impact analysis, and call graphs from Apache Doris scripts — it is the engine behind Gudu SQLFlow and the lineage integrations for DataHub and OpenMetadata.