Skip to content

Metadata::list_tables treats empty table_types slice as match-none (should match all, like null) #187

Closed

Description

@eric-wang-1990

Summary

Metadata::list_tables treats an empty table_types slice (Some(&[])) as "match nothing" and returns zero rows, contradicting the JDBC/ADBC contract where an empty type filter is equivalent to null and matches all table types (TABLE, VIEW, …).

Surfaced by the multi-language conformance suite (databricks-driver-test, spec METADATA-035), committed there as an xfail (#[should_panic]) tripwire that will flip red once this is fixed.

Root cause

metadata/thrift_shape.rs::reshape_tables: the

Some(types) => filter_tables_by_type(rows, types)

arm runs unconditionally for any Some, and filter_tables_by_type's types.iter().any(...) is always false for an empty slice, so every row is dropped. A source comment deliberately chose "empty == filter accepting nothing" for Thrift parity, but the spec (and the C# ADBC driver) require empty to match all.

Expected

list_tables(catalog, schema, Some(&[])) should return the same rows as list_tables(catalog, schema, None) — i.e. all table types (TABLE + VIEW both present).

Actual

Returns 0 rows.

Repro

Conformance test get_tables_empty_table_types_filter_matches_all in tests/kernel/tests/metadata_operations.rs (databricks-driver-test). It asserts both TABLE and VIEW are returned for an empty table_types; currently fails (hence the xfail marker).

Cross-driver note

databricks-jdbc has the same gap, tracked as databricks/databricks-jdbc#1570. The Thrift/HiveServer2 side is adbc-drivers/hiveserver2#72.

Activity

  1. added
    engineer-bot
    on Jul 30, 2026
  2. oss-engineer-bot commented on Jul 30, 2026

    @oss-engineer-bot

    🤖 engineer-bot opened a fix PR: #201

    Review before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineer-bot

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions