Parse SQL Structure
parse_sql_structureParses a SQL statement to extract CTEs, source tables, and projected columns for pipeline planning. Use this to inspect SQL decomposition before building a plan.
Instructions
Parse a SQL statement into its structural components without touching the workspace. Returns CTEs (if any), source table references (FROM/JOIN), and projected columns (SELECT list). Use this as the first step in a multi-step pipeline creation workflow to inspect the SQL decomposition before choosing node types or building a plan.
For CTE-based SQL, each CTE is returned with its columns (with transform detection), WHERE filters, source tables, structural flags (hasJoin, hasGroupBy), and inter-CTE dependency references.
For non-CTE SQL, returns the parsed source refs and SELECT items with column/expression classification.
This tool is pure parsing — no workspace reads, no node type selection, no mutations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL statement to parse. Pass it exactly as provided — do not rewrite or modify it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ctes | No | ||
| hasCtes | No | ||
| hasJoin | No | ||
| cteCount | No | ||
| guidance | No | ||
| warnings | No | ||
| sourceRefs | No | ||
| selectItems | No | ||
| sourceCount | No | ||
| selectItemCount | No | ||
| supportedSelectCount | No | ||
| unsupportedSelectCount | No |