@@ -406,6 +406,10 @@ class SelectQuery:
406406 bind_schema_path : Path | None = None
407407 #: Data for the bind parameters.
408408 bind_path : Path | None = None
409+ #: Schema of the result set (when not executing a query). For some
410+ #: databases and some situations, this is different than the schema you get
411+ #: when you actually execute the query.
412+ catalog_schema_path : Path | None = None
409413
410414 def setup_query (self ) -> str | None :
411415 if not self .setup_query_path :
@@ -434,6 +438,11 @@ def query(self) -> str:
434438 def expected_schema (self ) -> pyarrow .Schema :
435439 return try_txtcase (self .expected_schema_path , query_schema , ["expected_schema" ])
436440
441+ def catalog_schema (self ) -> pyarrow .Schema :
442+ if not self .catalog_schema_path :
443+ return self .expected_schema ()
444+ return try_txtcase (self .catalog_schema_path , query_schema , ["catalog_schema" ])
445+
437446 def expected_result (self ) -> pyarrow .Table :
438447 return try_txtcase (
439448 self .expected_path , query_table , ["expected" ], self .expected_schema ()
@@ -548,6 +557,8 @@ def merge(
548557 "expected_schema_path" : parent .query .expected_schema_path ,
549558 "expected_path" : parent .query .expected_path ,
550559 }
560+ if parent .query .catalog_schema_path :
561+ params ["catalog_schema_path" ] = parent .query .catalog_schema_path
551562 if parent .query .setup_query_path :
552563 params ["setup_query_path" ] = parent .query .setup_query_path
553564 # TODO: we also want to test with ExecuteQuery so perhaps
@@ -588,6 +599,7 @@ def merge(
588599 in {
589600 "query_path" ,
590601 "expected_schema_path" ,
602+ "catalog_schema_path" ,
591603 "expected_path" ,
592604 "setup_query_path" ,
593605 "bind_query_path" ,
0 commit comments