JanKaul commented on code in PR #8993:
URL: https://github.com/apache/arrow-datafusion/pull/8993#discussion_r1466410111
##########
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:
I'm not really sure about using the environment variables for the schema
owner. I guess datafusion doesn't really have the concept of an user and
therefore an owner. However, this is a required column and should somehow have
a value. Similar to the default catalog we could use "datafusion" here.
@alamb what do you think?
--
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]