From 04a0c3e90b7f76ee00ad57896d96020c91df14f2 Mon Sep 17 00:00:00 2001 From: Vu Anh Phung Date: Fri, 9 Oct 2026 18:08:38 +0000 Subject: [PATCH] fix(metadata): match list_tables table_types case-sensitively for Thrift parity #139 made the table_types filter case-insensitive, so ["table"] matched TABLE rows. Thrift GetTables matches exactly (server-side in SparkGetTablesOperation, and JDBC re-filters client-side the same way), so the kernel returned rows where Thrift returned none. Restore the exact match. Co-authored-by: Isaac Signed-off-by: Vu Anh Phung --- NEXT_CHANGELOG.md | 3 +++ src/metadata/thrift_shape.rs | 38 +++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 04384abb..7662fc32 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -50,6 +50,9 @@ changes go in their respective binding's NEXT_CHANGELOG. ### Fixed +- `list_tables` now matches `table_types` case-sensitively, matching Thrift + `GetTables`: `["table"]` no longer matches `TABLE` rows. + --- *Note: When making changes, please add your change under the appropriate section with a brief description. At release time, move the entries here diff --git a/src/metadata/thrift_shape.rs b/src/metadata/thrift_shape.rs index 3b806328..2a755096 100644 --- a/src/metadata/thrift_shape.rs +++ b/src/metadata/thrift_shape.rs @@ -607,7 +607,7 @@ pub(crate) fn reshape_tables( // earlier #72 reading (empty == null) after establishing that // databricks-jdbc's `listTables` has always short-circuited an empty // array to "return nothing". An empty `Some(&[])` therefore flows - // through `filter_tables_by_type`, whose `types.iter().any(..)` is + // through `filter_tables_by_type`, whose `types.contains(..)` is // `false` for every row → an empty (correctly-typed) batch. let filtered = match table_types { None => reshaped, @@ -1010,13 +1010,10 @@ fn filter_tables_by_type(batch: &RecordBatch, types: &[&str]) -> Result