Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,30 @@ ORDER BY sales DESC
LIMIT 100;
```

**Supported features:** cross-index `JOIN`s, `JOIN UNNEST`, window functions, aggregations, nested fields, geospatial queries, and more.
Subqueries and derived tables are part of DQL too — **since engine `0.24.0`**:

```sql
-- Subquery in WHERE — IN / NOT IN, EXISTS / NOT EXISTS, a scalar comparison,
-- or a quantified one (= ANY | SOME, <> ALL, > ALL, >= ANY, …)
SELECT name FROM employees
WHERE department_id IN (SELECT id FROM departments WHERE region = 'EU');

-- Derived table in FROM (also valid in JOIN, nested to any depth)
SELECT d.category, d.n
FROM (SELECT category, COUNT(*) AS n FROM bi_events GROUP BY category) d
WHERE d.n > 10;

-- Correlated subquery — the body reads the outer row
SELECT c.name FROM customers c
WHERE NOT EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.id);
```

- **Uncorrelated `WHERE` subqueries run on Elasticsearch itself**, so they work on every surface — including a plain REPL with no extensions.
- **Derived tables and correlated subqueries run on the relational engine** — since engine `0.24.0` with arrow-extensions `0.3.4` (`softclient4es-arrow-extensions`), the same engine that executes cross-index JOINs: the REPL's default install, the JDBC driver, the ADBC driver, the Arrow Flight SQL server and Federation all carry it. A venue without it refuses the statement with a clear error instead of executing it against the first index named.
- **Non-recursive CTEs run on that same relational engine** — a CTE reference *is* a derived table, so it carries the same venue requirement. A `WITH` clause is accepted at the top of a `SELECT` only; `WITH RECURSIVE` and CTE column lists (`WITH a (x, y) AS …`) are refused by name.
- **Set operators run on that engine too** — `UNION` / `UNION DISTINCT`, `INTERSECT` / `INTERSECT ALL`, `EXCEPT` / `EXCEPT ALL`. `UNION ALL` is the exception: Elasticsearch answers it directly with one `_msearch`, at every venue. Branches are matched by column **position**, and the result takes the first branch's names.

**Supported features:** cross-index `JOIN`s, `JOIN UNNEST`, subqueries, derived tables, CTEs, set operators, window functions, aggregations, nested fields, geospatial queries, and more.

📖 **[DQL Documentation](documentation/sql/dql_statements.md)**

Expand Down Expand Up @@ -509,6 +532,9 @@ Materialized views with JOINs rely on **Elasticsearch Watcher** to automatically
- [x] Arrow Flight SQL server (gRPC, Docker)
- [x] ADBC driver (in-process, columnar)
- [x] Cross-index JOINs
- [x] Subqueries (`IN` / `EXISTS` / scalar / quantified, correlated or not) and derived tables — `0.24.0`
- [x] Non-recursive CTEs (`WITH name AS (SELECT …)`) — `0.24.0`
- [x] Set operators (`UNION` / `UNION DISTINCT`, `INTERSECT` / `INTERSECT ALL`, `EXCEPT` / `EXCEPT ALL`) — `0.24.0`
- [ ] Advanced monitoring dashboard
- [ ] Additional SQL functions
- [ ] ES|QL bridge
Expand Down
2 changes: 1 addition & 1 deletion documentation/client/adbc_driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Multi-cluster **federation** — joining across *separate* ES clusters — is **

## What does NOT work yet

Subqueries (`IN (SELECT …)`, `EXISTS`, scalar, derived tables) and CTEs (`WITH`) are not supported in the current release — they arrive in a later release. Write the JOIN explicitly instead. See the Known Limitations & Roadmap (`../sql/known_limitations.md`) for the full list.
**Since engine `0.24.0`**, subqueries (`IN (SELECT …)` / `NOT IN`, `EXISTS` / `NOT EXISTS`, scalar and quantified comparisons) and derived tables (`FROM (SELECT …)`, `JOIN (SELECT …)`) are supported, correlated or not. **Non-recursive CTEs** (`WITH name AS (SELECT …)`) are supported too, at the top of a `SELECT`; `WITH RECURSIVE` and CTE column lists are refused by name. **Set operators** — `UNION ALL`, `UNION` / `UNION DISTINCT`, `INTERSECT` / `INTERSECT ALL`, `EXCEPT` / `EXCEPT ALL` — are supported as well; everything but `UNION ALL` runs on the relational engine this driver ships. See the Known Limitations & Roadmap (`../sql/known_limitations.md#subqueries-and-derived-tables`) for the forms that are still refused.

---

Expand Down
4 changes: 2 additions & 2 deletions documentation/client/arrow_flight_sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ The single-cluster sidecar on this page is the free shape. Multi-cluster **feder

## What does NOT work yet

Subqueries (`IN (SELECT …)`, `EXISTS`, scalar, derived tables) and CTEs (`WITH`) are not supported in the current release — they arrive in a later release. Write the JOIN explicitly instead. See the Known Limitations & Roadmap (`../sql/known_limitations.md`) for the full list.
**Since engine `0.24.0`**, subqueries (`IN (SELECT …)` / `NOT IN`, `EXISTS` / `NOT EXISTS`, scalar and quantified comparisons) and derived tables (`FROM (SELECT …)`, `JOIN (SELECT …)`) are supported, correlated or not. **Non-recursive CTEs** (`WITH name AS (SELECT …)`) are supported too, at the top of a `SELECT`; `WITH RECURSIVE` and CTE column lists are refused by name. **Set operators** — `UNION ALL`, `UNION` / `UNION DISTINCT`, `INTERSECT` / `INTERSECT ALL`, `EXCEPT` / `EXCEPT ALL` — are supported as well; everything but `UNION ALL` runs on the relational engine this driver ships. See the Known Limitations & Roadmap (`../sql/known_limitations.md#subqueries-and-derived-tables`) for the forms that are still refused.

---

Expand All @@ -218,7 +218,7 @@ The Arrow Flight SQL sidecar sends one anonymous usage ping per day (no IP, no S

## Known limitations

Subqueries, CTEs (`WITH`), and set operators beyond `UNION ALL` are not in R1 — and some BI tools auto-generate them. See [Known Limitations & Roadmap](../sql/known_limitations.md) for exactly what works today, what's coming in R2a, and the per-tool workaround.
Subqueries, derived tables, non-recursive CTEs — which some BI tools auto-generate — and the `UNION` / `INTERSECT` / `EXCEPT` set operators all work since engine `0.24.0`. See [Known Limitations & Roadmap](../sql/known_limitations.md#subqueries-and-derived-tables) for exactly what works today and what is still refused.

---

Expand Down
33 changes: 21 additions & 12 deletions documentation/client/bi_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ Tableau's own connector documentation says that when the temp-table capabilities
*"Tableau will attempt to generate an alternative query to retrieve the necessary results."*

The probe therefore costs one failed round trip per connection and is not itself a problem. What
follows it can be: Tableau's alternative for a source without temporary tables uses **subqueries**,
which this release does not accept, so some interactions fail — with the same kind of clear error
naming the statement, never a hang and never a silently wrong answer. Tableau's own documentation
also warns that the subquery path *"can be poor, particularly with large datasets."* See the
Honest-gap note below for what lands when.
follows it is Tableau's alternative for a source without temporary tables, which uses **subqueries** —
and **since engine `0.24.0`** subqueries and derived tables are accepted. (The quoted,
fully-qualified identifiers Tableau emits alongside them have parsed since `0.23.0`; what `0.24.0`
added is executing the derived-table wrapper.) Tableau's own documentation warns
that the subquery path *"can be poor, particularly with large datasets"*, so it is a performance
characteristic to watch rather than a refusal. Note that a derived table runs on the relational engine —
since engine `0.24.0` with arrow-extensions `0.3.4` — and the JDBC driver ships it, so a Tableau
connection has it.

**A Tableau datasource customization file (`.tdc`) cannot suppress the probe.** The capability that
would do it, `CAP_SUPPRESS_TEMP_TABLE_CHECKS`, is not among the capabilities Tableau documents for
Expand All @@ -53,10 +56,16 @@ dead end worth not walking down.

## Honest-gap note

The superpower of this release is a **cross-index JOIN** that Elasticsearch can't do, and it runs best
through explicit `JOIN … ON …` SQL — from any tool where you control the statement that is sent (Superset
SQL Lab, DBeaver, Grafana). Some BI tools compose SQL for you: subqueries and CTEs are not in this release
yet, and neither is the quoted, fully-qualified identifier form Tableau generates. Tableau's Custom SQL is
not a way around that — Tableau wraps a custom query inside a `SELECT … FROM ( … )`, which is a derived
table (Tableau's Custom SQL documentation, checked 2026-09-01). Full BI-tool subquery / CTE support is coming in the next release (Quarter 4 2026). See the
website's Known Limitations page for the full picture.
The superpower of this release is a **cross-index JOIN** that Elasticsearch can't do. It runs from explicit
`JOIN … ON …` SQL and, **since engine `0.24.0`**, from the nested SQL a BI tool composes for you:
**subqueries and derived tables are accepted**, and so is the quoted, fully-qualified identifier form
Tableau generates.
Tableau's Custom SQL wraps your query inside a `SELECT … FROM ( … )` (Tableau's Custom SQL documentation,
checked 2026-09-01) — that wrapper is a derived table, which now runs on the relational engine the JDBC
driver ships.

Non-recursive **CTEs** (`WITH …`) and the **set operators** (`UNION`, `INTERSECT`, `EXCEPT`, with or
without `ALL`) run on that same engine since `0.24.0` — a CTE reference is a derived table, and a set
operation is its branches executed separately and combined. `UNION ALL` alone still runs on Elasticsearch,
as it always has. See the website's Known Limitations page for the full picture, including the subquery
and set-operator forms that are still refused by name.
4 changes: 2 additions & 2 deletions documentation/client/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ The JDBC driver supports the full SQL Gateway syntax:

- **DDL** — CREATE/ALTER/DROP TABLE, pipelines, watchers, enrich policies
- **DML** — INSERT, UPDATE, DELETE, COPY INTO
- **DQL** — SELECT with WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, UNION ALL, JOIN UNNEST, window functions
- **DQL** — SELECT with WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, set operators (`UNION [ALL]` / `INTERSECT` / `EXCEPT`), JOIN UNNEST, window functions
- **SHOW/DESCRIBE** — Tables, pipelines, watchers, enrich policies

---
Expand Down Expand Up @@ -324,7 +324,7 @@ Multi-cluster **federation** — joining across *separate* ES clusters — is **

## What does NOT work yet

Subqueries (`IN (SELECT …)`, `EXISTS`, scalar, derived tables) and CTEs (`WITH`) are not supported in the current release — they arrive in a later release. Write the JOIN explicitly instead. See the Known Limitations & Roadmap (`../sql/known_limitations.md`) for the full list.
**Since engine `0.24.0`**, subqueries (`IN (SELECT …)` / `NOT IN`, `EXISTS` / `NOT EXISTS`, scalar and quantified comparisons) and derived tables (`FROM (SELECT …)`, `JOIN (SELECT …)`) are supported, correlated or not. **Non-recursive CTEs** (`WITH name AS (SELECT …)`) are supported too, at the top of a `SELECT`; `WITH RECURSIVE` and CTE column lists are refused by name. **Set operators** — `UNION ALL`, `UNION` / `UNION DISTINCT`, `INTERSECT` / `INTERSECT ALL`, `EXCEPT` / `EXCEPT ALL` — are supported as well; everything but `UNION ALL` runs on the relational engine this driver ships. See the Known Limitations & Roadmap (`../sql/known_limitations.md#subqueries-and-derived-tables`) for the forms that are still refused.

---

Expand Down
Loading
Loading