Table Queries
3 nodes
On this page 3
Explain SQL
FunctionThe plan the engine makes for a SQL SELECT over tables - which filters it pushes down, which side of a join it hashes - as text, to see why a query is slow or what it does.
Signature
ExplainSQL -> Text
tables: Table Array
SQL: Text
names: Text Arraystring ExplainSQL(Table[] tables, string sql, string[] names)
Parameters
| name | type | default | description |
|---|---|---|---|
| tables | Table Array | — | The tables to query. |
| SQL | Text | — | The SELECT statement. |
| names | Text Array | — | What each table is called in the SQL, in the same order. |
Returns
| Plan | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Table Queries
- Package
- Data Analytics
Load
FunctionThe tables loaded under their names: the name given, else the table's own, else Table1, Table2 and so on.
Signature
Load(tables: Table Array, names: Text Array) -> Table Database
TableDatabase Load(Table[] tables, string[] names)
Parameters
| name | type | default | description |
|---|---|---|---|
| tables | Table Array | — | |
| names | Text Array | — |
Returns
| result | Table Database |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Table Queries
- Package
- Data Analytics
Query With SQL
FunctionThe answer to a SQL SELECT over tables, as a table: SELECT Region, SUM(Revenue) AS Revenue FROM Sales GROUP BY Region ORDER BY Revenue DESC.
Signature
QueryWithSQL -> Table
tables: Table Array
SQL: Text
names: Text ArrayTable QueryWithSQL(Table[] tables, string sql, string[] names)
Parameters
| name | type | default | description |
|---|---|---|---|
| tables | Table Array | — | The tables to query. |
| SQL | Text | — | The SELECT statement. |
| names | Text Array | — | What each table is called in the SQL, in the same order; each table's own name, or Table1, Table2…, where not given. |
Returns
| Result | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Table Queries
- Package
- Data Analytics