Skip to content

[bulk] Stop labelling every sql failure "SQL query error" (closes #346) - #347

Merged
hunterhacker merged 2 commits into
mainfrom
explain-dead-jvm-instead-of-blaming-the-verb
Sep 2, 2026
Merged

[bulk] Stop labelling every sql failure "SQL query error" (closes #346)#347
hunterhacker merged 2 commits into
mainfrom
explain-dead-jvm-instead-of-blaming-the-verb

Conversation

@hunterhacker

@hunterhacker hunterhacker commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes #346.

What it does

sql wrapped any exception as SQL query error: <message>. get_error_message already returns a standalone sentence, so the prefix added nothing to a real query mistake and mislabelled failures that were not the query's fault:

failure before after
bad column SQL query error: [UNRESOLVED_COLUMN] A column ... Did you mean [sk, pk]? [UNRESOLVED_COLUMN] A column ... Did you mean [sk, pk]?
denied scan SQL query error: ...is not authorized... ...is not authorized...
dead executor SQL query error: Task ...rejected from ThreadPoolExecutor[...] Task ...rejected from ThreadPoolExecutor[...]

One line of behaviour: drop the prefix, keep the BulkExecutorError wrap so root.py still exits clean with no traceback.

Why this and not more

An earlier version of this branch taught the driver to recognise a dead JVM and phrase it as "ran out of memory". That was a guess -- ExecutorLostFailure / rejected from ThreadPoolExecutor also mean a spot reclaim or a network partition -- and it duplicated the client, which detects a real memory failure from the executor's own OutOfMemoryError line and Glue's OUT_OF_MEMORY_ERROR category (#348, merged). The driver has no business guessing what the client can see, so that whole layer is gone; this is just the prefix.

load's Could not read the source as '<format>' is left alone -- unlike the SQL prefix it makes a useful, usually-correct claim about the common wrong---format mistake.

Tests

Two existing test_sql cases asserted the prefix; both updated -- one now checks the underlying message comes through without it, the other kept its real point (a Spark-side failure is not mislabelled "Invalid 'limit'").

Server-side, so re-bootstrap after merging. make test: 1187 server passing.

`sql` wrapped any exception from spark.sql as "SQL query error: <message>". get_error_message
already returns a standalone sentence, so the prefix added nothing to a real query mistake --
"[UNRESOLVED_COLUMN] A column ... Did you mean [sk, pk]?" reads fine on its own -- and actively
mislead on failures that were not the query's fault:

  denial         SQL query error: ...is not authorized to perform: dynamodb:Scan...
  dead executor  SQL query error: Task ...rejected from ...ThreadPoolExecutor[Shutting down...]

Both became the run's one-line reason, sending a user to re-read SQL that was fine. Dropping
the prefix fixes it in one line; the BulkExecutorError wrap stays, so root.py still exits with
one clean line and no traceback.

Deliberately not doing more. An earlier draft of this change taught the driver to recognise a
dead JVM and guess "ran out of memory" from symptoms like ExecutorLostFailure -- but those also
mean a spot reclaim or a network partition, so it was a guess, and the client already detects a
real memory failure from the executor's own OutOfMemoryError line and Glue's OUT_OF_MEMORY_ERROR
category. The driver has no business guessing what the client can see. `load`'s "Could not read
the source as '<format>'" is left alone: unlike the SQL prefix it makes a useful, usually-correct
claim about the common wrong-format mistake.
@hunterhacker
hunterhacker force-pushed the explain-dead-jvm-instead-of-blaming-the-verb branch from be184d8 to 3cc8651 Compare September 2, 2026 07:14
@hunterhacker hunterhacker changed the title [bulk] Stop blaming the verb when the JVM dies underneath it (closes #346) [bulk] Stop labelling every sql failure "SQL query error" (closes #346) Sep 2, 2026
The no-prefix rationale was a six-line essay quoting three example messages; it belongs in the
PR, not next to a one-line raise. Cut to why the wrap exists at all (clean one-line exit). Also
fixed the passthrough comment above it, which still promised not to wrap things "into an opaque
'SQL query error'" -- a prefix that no longer exists.
@hunterhacker
hunterhacker merged commit 106fa1e into main Sep 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bulk_executor All bulk executor tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bulk] sql labels every failure "SQL query error", including denials and infra failures

1 participant