[SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code#421
Open
msrathore-db wants to merge 2 commits into
Open
[SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code#421msrathore-db wants to merge 2 commits into
msrathore-db wants to merge 2 commits into
Conversation
|
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 ( |
|
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 ( |
…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>
ff84993 to
ebb51c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Thriftbackend raises
OperationStateError(Error)for the same situation (operation reachesERROR_STATE).A Thrift-vs-SEA comparator run flagged every error path as a class mismatch
(
OperationStateErrorvsHiveDriverError). The Python kernel connector matches Thrift'serror class here, confirming the kernel raises consistent errors — the divergence was in
this Node mapping.
Change
lib/sea/SeaErrorMapping.ts: map kernelSqlError→OperationStateError(OperationStateErrorCode.Error), preserving the kernel message.OperationStateError extends HiveDriverError, so existinginstanceof HiveDriverErrorcatches are unaffected. All other mappings (
InvalidArgument→ParameterError, 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.