Skip to content

JOIN queries without a join-capable extension silently return wrong results #157

Description

@fupelaqu

Symptom

On a REPL/gateway with only the core assembly (no softclient4es-arrow-extensions on the classpath — e.g. install.sh --no-extensions, Java 8, or any pre-classpath-launcher install), a SELECT … JOIN across indices does NOT fail. It executes as a single-index search over the left table: joined columns come back NULL, orphan rows are not dropped, and the user has no signal anything is wrong.

Verified live (ES 8.18.3, cli 0.20.0): jdbc_join_emp ⋈ jdbc_join_dept returned 6 rows with dept_name = NULL including the orphan.

Root cause

CoreDqlExtension.canHandle claims every DqlStatement (core/src/main/scala/app/softnetwork/elastic/client/extensions/CoreDqlExtension.scala:91-94) and its execute path (and the base dqlExecutor fallback) translate only the first table of the FROM clause; the JOIN is silently dropped. EnforcedDqlExtension inherits the same behaviour (see softclient4es-arrow#125 for the related priority collision).

Expected

A statement whose from.enrichmentRequired is true (cross-index JOIN present) must fail loudly when it reaches a handler that cannot join, e.g.:

Cross-index JOIN requires the softclient4es-arrow-extensions jar (Java 11+). Re-run the installer, or run with --no-extensions removed. See documentation/client/repl.md#extensions.

Suggested fix: guard in CoreDqlExtension.execute (inherited by EnforcedDqlExtension) — with the JOIN extension registered at priority 40 (arrow#125) join statements never reach it; without it, users get a clear 400 instead of wrong data. Needs a 0.20.1 core release to reach the published CLI assembly.

Found during the R1 installer E2E verification (PR #156).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions