parseSql
The SqlAdapter.parseSql method parses a SQL query string into a TableSpec using an explicit Scope (catalog). This is a low-level API that provides full control over the catalog/scope, unlike the higher-level evaluate and dryRun methods, which automatically use the script session's query scope.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| sql | String | The SQL query string to parse. |
| scope | Scope | The Scope object that defines the catalog of available tables for the SQL query. This must be constructed explicitly using |
Returns
A TableSpec object representing the parsed SQL query. It refers to the catalog's tables through the TableSpec placeholders in the Scope. Deephaven has no public API to turn this TableSpec into a table; to run a SQL query, use evaluate.
Examples
The output is the parsed query plan in Graphviz DOT format. Each ticketTable node is a placeholder from the Scope, and the view and join nodes are the operations that the query applies to those tables.