Skip to content

[SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code#421

Open
msrathore-db wants to merge 2 commits into
mainfrom
msrathore/sea-sqlerror-operationstate-parity
Open

[SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code#421
msrathore-db wants to merge 2 commits into
mainfrom
msrathore/sea-sqlerror-operationstate-parity

Conversation

@msrathore-db
Copy link
Copy Markdown
Contributor

What

On the SEA/kernel backend, server-reported SQL execution failures (kernel SqlError
e.g. table-not-found, syntax error, unresolved column, divide-by-zero, invalid cast,
parameter type mismatch) were surfaced as the base HiveDriverError. The Thrift
backend raises OperationStateError(Error) for the same situation (operation reaches
ERROR_STATE).

A Thrift-vs-SEA comparator run flagged every error path as a class mismatch
(OperationStateError vs HiveDriverError). The Python kernel connector matches Thrift's
error class here, confirming the kernel raises consistent errors — the divergence was in
this Node mapping.

Change

lib/sea/SeaErrorMapping.ts: map kernel SqlError
OperationStateError(OperationStateErrorCode.Error), preserving the kernel message.
OperationStateError extends HiveDriverError, so existing instanceof HiveDriverError
catches are unaffected. All other mappings (InvalidArgumentParameterError, auth,
network, etc.) are unchanged.

Verification

Ran the Node Thrift-vs-SEA comparator (ERROR_PATHS suite) against a live warehouse: all six
cases — table-not-found, syntax error, unresolved column, divide-by-zero, invalid cast, and
parameter type mismatch — now match the Thrift backend's exception class (were all
mismatches before).

This pull request and its description were written by Isaac.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

@msrathore-db msrathore-db changed the title [SEA-NodeJS] map kernel SqlError to OperationStateError for Thrift parity [SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code Jun 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

…rity

Server-reported SQL execution failures (kernel `SqlError` — bad query,
missing table, divide-by-zero, invalid cast, param type mismatch) were
surfaced as the base `HiveDriverError` on the SEA/kernel path, while the
Thrift backend raises `OperationStateError(Error)` when the operation
reaches ERROR_STATE. The comparator flagged every error path as a
class mismatch (Thrift `OperationStateError` vs SEA `HiveDriverError`),
and the Python kernel connector matches Thrift here — so the divergence
was in this mapping, not the kernel.

Map `SqlError` -> `OperationStateError(OperationStateErrorCode.Error)`,
preserving the kernel message. `OperationStateError extends
HiveDriverError`, so existing `instanceof HiveDriverError` catches are
unaffected. Other code mappings (InvalidArgument -> ParameterError,
auth, network, etc.) are unchanged.

Verified against the comparator warehouse: all ERROR_PATHS cases
(table-not-found, syntax error, unresolved column, divide-by-zero,
invalid cast, param mismatch) now match the Thrift backend.

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
…kernel parity)

The SEA Arrow→Thrift type synthesis surfaced interval columns with the true
INTERVAL_YEAR_MONTH / INTERVAL_DAY_TIME type ids, while the Thrift backend and
the Python kernel connector both report interval columns with a STRING type
code. The comparator flagged every interval column as a type-code mismatch.

Map INTERVAL (via databricks.type_name, the rewritten-duration Int64 path, and
the native Arrow interval fallback) to STRING_TYPE. The cell value is already
rendered to the canonical interval string ("2-6" / "3 12:30:15.000000000") by
ArrowResultConverter, which keys off the Arrow value type — not this synthesized
TTypeId — so value formatting is unchanged.

Verified against the comparator warehouse: STATEMENT_SELECT / EXTREME_VALUES
interval columns now match the Thrift backend (type 7 + identical string value).

Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
@msrathore-db msrathore-db force-pushed the msrathore/sea-sqlerror-operationstate-parity branch from ff84993 to ebb51c0 Compare June 5, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant