Skip to main content
Java 8 · Druid 1.2.28 · 15+ dialects

SqlParserX

A multi-dialect SQL parsing engine and toolkit

SQL type detection · Table & column lineage · Table/DDL parsing · Function extraction · Parameter extraction and prepared SQL

  • 15Datasource dialects
  • 6Core capabilities
  • 2Unified layers
  • 100%Java 8 compatible
LineagePreview
SQL Input
INSERT INTO dwd.order_di
SELECT o.id, u.name, o.amount
FROM ods.orders o
JOIN ods.users u ON o.uid = u.id;
Parse Result
✓Table lineageods.orders → dwd.order_di
✓表血缘ods.users → dwd.order_di
✓Field lineageods.orders.amount → dwd.order_di.amount

15+ datasource dialects supported

MySQL
Hive
Doris
StarRocks
ClickHouse
Oracle
PostgreSQL
Spark
Trino
DM
OceanBase
OceanBase Oracle
SQL Server
Greenplum
TiDB
Capabilities

One engine for the full SQL parsing pipeline

From dialect syntax to business semantics — unified contract, unified result, ready to use.

SQL type detection

Detect query, DML, DDL, SHOW and EXPLAIN statement types.

Table & DDL parsing

Resolve real tables through JOINs, CTEs and subqueries, then parse fields, keys, partitions and buckets.

Table lineage

Trace data flow from source tables to targets in INSERT and CTAS statements.

Column lineage

Map source columns to targets across expressions, functions and CASE clauses.

Function parsing

Extract and deduplicate regular, aggregate and window function names across multiple statements.

Parameter extraction & prepared SQL

Extract dynamic SELECT parameters and produce JDBC placeholder SQL with ordered bindings.

Architecture

Two-layer unified extension architecture

The syntax layer extends dialect Lexer/Parser/AST on Druid; the business layer extends parsing, lineage and rewriting via the ISqlParser contract, aligned by DbType and AST.

  1. 1Feed SQL + DbType
  2. 2Syntax layer parses into Druid AST
  3. 3Business layer unified parsing
  4. 4Table / lineage / function / parameter results
SqlParserX 两层架构
Documentation

Version / i18n coexistence

Switch version (1.0 / Next) and language (简体中文 / English) from the navbar.

version

Ready to parse your SQL?

Get started in minutes with multi-dialect parsing, lineage tracing and prepared SQL.