Repository navigation
Commit be910c9
committed
fix(metadata): empty table_types slice matches NONE, not all (hiveserver2 #83)
`reshape_tables` special-cased `Some(&[])` (explicit empty table_types
slice) as match-ALL, equivalent to `None` — added in #201 (fix for #187)
and relied on by #223's C-ABI cleanup. That premise was reversed by
adbc-drivers/hiveserver2 #83: an empty type filter matches NOTHING (zero
rows), matching databricks-jdbc's long-standing `listTables` short-circuit,
and driver-test's METADATA-035 conformance test was flipped to expect
match-none on 2026-08-06. The kernel driver landed the opposite behavior on
2026-08-10, so the live nightly (get_tables_empty_table_types_filter_matches_none,
both normal and reyden legs) went red: the test demands 0 rows, the driver
returned all rows.
Realign the driver with the canonical (#83) contract:
- thrift_shape.rs: drop the `Some([]) => reshaped` arm so an empty slice
flows through `filter_tables_by_type`, whose `types.iter().any(..)` is
false for every row → a correctly-typed empty batch. Only `None` now
means match-all. Rewrote the inline + doc comments (they cited the
reversed #72 reading).
- thrift_shape.rs unit test: tables_empty_types_matches_all →
tables_empty_types_matches_none (asserts 0 rows).
- c_abi/metadata.rs: re-add the empty-CSV → `None` collapse that #223
removed. ODBC passes "" / whitespace / comma-only junk for "no type
filter" (match-all); now that `Some(&[])` means match-none again on the
Rust surface, the C-ABI boundary must collapse an empty parse back to
`None` to preserve ODBC's empty→"all types" convention. Keeps #223's
`split_table_types_csv` helper; restores the pre-#223 guard via
`.filter(|t| !t.is_empty())`. The napi/pyo3 typed surfaces intentionally
pass `Some(&[])` through (match-none), consistent with the Rust API.
Validated: 766 lib unit tests pass; fmt + clippy clean; the live E2E
get_tables_empty_table_types_filter_matches_none passes against a real
warehouse (was red in the nightly). Reopens/supersedes #187 (its match-all
premise is overturned by #83).
Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>1 parent 3ea1c3b commit be910c9
2 files changed
Lines changed: 80 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
193 | 215 | | |
194 | 216 | | |
195 | 217 | | |
| |||
227 | 249 | | |
228 | 250 | | |
229 | 251 | | |
230 | | - | |
| 252 | + | |
231 | 253 | | |
232 | 254 | | |
233 | 255 | | |
| |||
504 | 526 | | |
505 | 527 | | |
506 | 528 | | |
507 | | - | |
508 | | - | |
509 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
510 | 533 | | |
511 | 534 | | |
512 | 535 | | |
| |||
524 | 547 | | |
525 | 548 | | |
526 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
527 | 577 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
547 | | - | |
548 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
| |||
599 | 600 | | |
600 | 601 | | |
601 | 602 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
606 | 611 | | |
607 | 612 | | |
608 | | - | |
609 | 613 | | |
610 | 614 | | |
611 | 615 | | |
| |||
1338 | 1342 | | |
1339 | 1343 | | |
1340 | 1344 | | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1346 | 1350 | | |
1347 | 1351 | | |
1348 | | - | |
| 1352 | + | |
1349 | 1353 | | |
1350 | 1354 | | |
1351 | 1355 | | |
1352 | 1356 | | |
1353 | 1357 | | |
1354 | | - | |
1355 | | - | |
| 1358 | + | |
| 1359 | + | |
1356 | 1360 | | |
1357 | 1361 | | |
1358 | 1362 | | |
| |||
0 commit comments