Split out of #1863 (see its review discussion).
DatasetQuery.union/join/subtract validate only Catalog.in_memory (_ensure_same_catalog_mode). Combinations across catalogs that live in different databases but share a mode are accepted and fail much later, deep in SQL execution, with a misleading missing-table error:
Proposal:
- add
Catalog.database_identity (or is_compatible_with(other)) derived from the execution warehouse/database — for SQLite, the normalized db file or shared-memory identity; for server warehouses, the connection identity
- use it from
union, join, subtract instead of the mode flag
- cover: two different persistent SQLite files (reject early), the same database through two sessions (allowed), distinct in-memory identities (reject early)
This gap predates #1863 for persistent catalogs; the mode check added there intentionally covers only the mixed in-memory/persistent case.
🤖 Generated with Claude Code
Split out of #1863 (see its review discussion).
DatasetQuery.union/join/subtractvalidate onlyCatalog.in_memory(_ensure_same_catalog_mode). Combinations across catalogs that live in different databases but share a mode are accepted and fail much later, deep in SQL execution, with a misleading missing-table error:Proposal:
Catalog.database_identity(oris_compatible_with(other)) derived from the execution warehouse/database — for SQLite, the normalized db file or shared-memory identity; for server warehouses, the connection identityunion,join,subtractinstead of the mode flagThis gap predates #1863 for persistent catalogs; the mode check added there intentionally covers only the mixed in-memory/persistent case.
🤖 Generated with Claude Code