zhuqi-lucas commented on code in PR #23438:
URL: https://github.com/apache/datafusion/pull/23438#discussion_r3592437393


##########
datafusion/catalog/src/information_schema.rs:
##########
@@ -81,14 +82,28 @@ impl InformationSchemaProvider {
     /// Creates a new [`InformationSchemaProvider`] for the provided 
`catalog_list`
     pub fn new(catalog_list: Arc<dyn CatalogProviderList>) -> Self {
         Self {
-            config: InformationSchemaConfig { catalog_list },
+            config: InformationSchemaConfig {
+                catalog_list,
+                table_functions: HashMap::new(),
+            },
         }
     }
+
+    /// Attach the session's table (UDTF) functions so that they appear in
+    /// `information_schema.routines` / `SHOW FUNCTIONS`.
+    pub fn with_table_functions(
+        mut self,
+        table_functions: HashMap<String, Arc<TableFunction>>,
+    ) -> Self {
+        self.config.table_functions = table_functions;
+        self
+    }
 }
 
 #[derive(Clone, Debug)]
 struct InformationSchemaConfig {
     catalog_list: Arc<dyn CatalogProviderList>,
+    table_functions: HashMap<String, Arc<TableFunction>>,

Review Comment:
   Thanks @alamb for good catch, refreshed the PR description with the concrete 
cycle explanation. 
   
   TableFunction lives in datafusion-catalog, which already depends on 
datafusion-session — putting table_functions() on the Session trait reverses 
that edge. Scalar/Agg live in datafusion-expr (below session), so no cycle 
there. Same root as #23348 — I'll open a follow-up PR that moves TableFunction 
down and deletes with_table_functions().



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