pepijnve commented on code in PR #25887:
URL: https://github.com/apache/datafusion/pull/25887#discussion_r4192387307


##########
datafusion/sqllogictest/test_files/information_schema_multiple_catalogs.slt:
##########
@@ -76,25 +76,24 @@ set datafusion.catalog.default_schema = my_other_schema;
 statement ok
 create table t3 as values(1);
 
+query TTT rowsort
+SELECT table_catalog, table_schema, table_name
+FROM my_catalog.information_schema.tables
+WHERE table_schema <> 'information_schema';
+----
+my_catalog my_schema t1
+my_catalog my_schema t2
+
+query TTT rowsort
+SELECT table_catalog, table_schema, table_name
+FROM my_other_catalog.information_schema.tables
+WHERE table_schema <> 'information_schema';
+----
+my_other_catalog my_other_schema t3
+
 query TTTT rowsort
 SELECT * from information_schema.tables;

Review Comment:
   What I've tried to implement in this PR is what's described at 
https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-information-schema
   
   > In the SYSTEM catalog, the INFORMATION_SCHEMA is a SQL standard schema 
that provides metadata about objects across all catalogs in the metastore. It 
does not contain metadata about hive_metastore objects.
   >
   > Separately, each catalog created in Unity Catalog also automatically 
includes an information_schema that describes metadata about objects in that 
catalog only.
   
   The behaviour you're seeing here is that the default catalog was set to 
`my_other_catalog`. `information_schema.tables` then resolves to 
`my_other_catalog.information_schema.tables` which only describes the objects 
in `my_other_catalog`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to