Tangruilin commented on code in PR #8993:
URL: https://github.com/apache/arrow-datafusion/pull/8993#discussion_r1466418460


##########
datafusion/core/src/catalog/information_schema.rs:
##########
@@ -115,6 +117,33 @@ impl InformationSchemaConfig {
                 DF_SETTINGS,
                 TableType::View,
             );
+            builder.add_table(
+                &catalog_name,
+                INFORMATION_SCHEMA,
+                SCHEMATA,
+                TableType::View,
+            );
+        }
+    }
+
+    async fn make_schemata(&self, builder: &mut InformationSchemataBuilder) {
+        for catalog_name in self.catalog_list.catalog_names() {
+            let catalog = self.catalog_list.catalog(&catalog_name).unwrap();
+
+            for schema_name in catalog.schema_names() {
+                if schema_name != INFORMATION_SCHEMA {
+                    // schema name may not exist in the catalog, so we need to 
check
+                    // then get user from env
+                    let schema_owner = match std::env::var("USER") {
+                        Ok(user) => user,
+                        Err(_) => match std::env::var("USERNAME") {
+                            Ok(user) => user,
+                            Err(_) => "".to_owned(),
+                        },
+                    };

Review Comment:
   Now I get the System User from environment variables, which is same as 
postgresql.
   
   Maybe you will have some good suggestions? It seems that datafusion do not 
have a user 



-- 
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]

Reply via email to