You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2023/06/03 12:51:35 UTC

[GitHub] [arrow-datafusion] Weijun-H commented on a diff in pull request #6536: fix: ignore panics if racing against catalog/schema changes

Weijun-H commented on code in PR #6536:
URL: https://github.com/apache/arrow-datafusion/pull/6536#discussion_r1215502322


##########
datafusion/core/src/catalog/information_schema.rs:
##########
@@ -81,15 +81,17 @@ impl InformationSchemaConfig {
 
             for schema_name in catalog.schema_names() {
                 if schema_name != INFORMATION_SCHEMA {
-                    let schema = catalog.schema(&schema_name).unwrap();
-                    for table_name in schema.table_names() {
-                        let table = schema.table(&table_name).await.unwrap();
-                        builder.add_table(
-                            &catalog_name,
-                            &schema_name,
-                            &table_name,
-                            table.table_type(),
-                        );
+                    // schema name may not exist in the catalog, so we need to check
+                    if let Some(schema) = catalog.schema(&schema_name) {
+                        for table_name in schema.table_names() {
+                            let table = schema.table(&table_name).await.unwrap();
+                            builder.add_table(

Review Comment:
   Yes, it makes sense



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org