avantgardnerio commented on code in PR #4112:
URL: https://github.com/apache/arrow-datafusion/pull/4112#discussion_r1014448512


##########
datafusion-cli/src/main.rs:
##########
@@ -106,6 +113,20 @@ pub async fn main() -> Result<()> {
     let mut ctx =
         SessionContext::with_config_rt(session_config.clone(), 
Arc::new(runtime_env));
 
+    let cat_names = ctx.catalog_names().clone();
+    for cat_name in cat_names.iter() {
+        let cat = ctx.catalog(cat_name.as_str()).
+            ok_or(DataFusionError::Internal("Catalog not 
found!".to_string()))?;
+        for schema_name in cat.schema_names() {
+            let schema = cat.schema(schema_name.as_str())
+                .ok_or(DataFusionError::Internal("Schema not 
found!".to_string()))?;
+            let lister = 
schema.as_any().downcast_ref::<ListingSchemaProvider>();
+            if let Some(lister) = lister {
+                lister.refresh(&ctx.state()).await?;

Review Comment:
   Register tables on startup.



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