Learn General SQL Parser with Java¶
Follow this path when you want to learn how GSP works by building and extending a Java SQL analysis program. The lessons are sequential: each one assumes the parser workflow and AST concepts introduced by the previous lesson.
If you need to complete one specific task instead, use the guide finder. C# developers can start from the .NET task and demo guide.
Complete the Quick Start Begin the Java learning path
Before you begin¶
Use the Quick Start as the single source for current Java and .NET installation instructions, public package versions, framework compatibility, and first-parser setup. Return here after the Java example runs successfully.
You should be comfortable reading Java and basic SELECT, INSERT, UPDATE,
and DELETE statements. The tutorials use Java because they follow one
continuous sample path; the task-focused guides provide paired Java and .NET
source where both implementations are available.
Java learning path¶
1. Build your first SQL analysis tool¶
Run a real demo, follow SQL through dialect selection, parsing, statement classification, and AST inspection, then change the input and observe how the structured result changes.
You will be able to: explain the parse workflow, recognize a successful or failed parse, and choose the next AST object to inspect.
2. Parse common SQL statements¶
Work with SELECT, INSERT, UPDATE, and DELETE, then inspect projections,
tables, joins, filters, and statement-specific properties.
You will be able to: map application questions such as “which table does this statement write?” to the statement and node APIs that answer them.
3. Work with database dialects¶
Select the grammar that matches the system that produced the SQL and compare Oracle PL/SQL, SQL Server T-SQL, PostgreSQL-family, MySQL, Snowflake, and Teradata syntax.
You will be able to: avoid false errors caused by a mismatched dialect and route vendor-specific SQL to the correct parser configuration.
4. Apply advanced SQL analysis patterns¶
Modify an AST, regenerate SQL, write a visitor, split scripts, and choose a performance strategy for larger workloads.
You will be able to: move from a local parser example to a reusable analysis or transformation component in your own application.
Choose a shorter route¶
| Your goal | Recommended path |
|---|---|
| Evaluate the SDK quickly | Quick Start, then build the first analysis tool |
| Add validation to an editor or CI pipeline | Quick Start, then offline syntax validation |
| Build a catalog or SQL inventory | Lessons 1–2, then table and column extraction |
| Build migration tooling | Lessons 1–3, then the dialect guides |
| Rewrite or govern SQL | Lessons 1–2 and 4, then safe AST modification |
| Trace data lineage | Lessons 1–2, then column-level lineage |
Continue after the learning path¶
- Use Build with GSP to find production guidance and runnable Java/.NET projects for a specific task.
- Use Reference to look up AST nodes, API details, dialect coverage, configuration, and release information.
- Read concepts and architecture when you need to understand why the parser, token stream, AST, resolver, and analysis layers behave as they do.
- Review solutions and use cases to map these capabilities into a SQL safety, developer-tooling, governance, or migration architecture.