Commit 5413ff9
authored
[SEA-NodeJS] Thrift-parity fixes: SQL error class + INTERVAL type code (#421)
* [SEA-NodeJS] map kernel SqlError to OperationStateError for Thrift parity
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>
* [SEA-NodeJS] report INTERVAL columns as STRING_TYPE (Thrift / Python 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>
---------
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 21df925 commit 5413ff9
3 files changed
Lines changed: 36 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
| |||
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
176 | | - | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
180 | | - | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
198 | 203 | | |
199 | 204 | | |
200 | 205 | | |
201 | | - | |
202 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
203 | 210 | | |
204 | | - | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
| |||
233 | 240 | | |
234 | 241 | | |
235 | 242 | | |
236 | | - | |
237 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
238 | 247 | | |
239 | 248 | | |
240 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
150 | 164 | | |
151 | 165 | | |
152 | 166 | | |
| |||
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
159 | | - | |
160 | 173 | | |
161 | 174 | | |
162 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
406 | 411 | | |
407 | 412 | | |
408 | | - | |
409 | | - | |
410 | 413 | | |
411 | | - | |
| 414 | + | |
412 | 415 | | |
413 | 416 | | |
414 | 417 | | |
| |||
0 commit comments