alamb commented on code in PR #23438:
URL: https://github.com/apache/datafusion/pull/23438#discussion_r3587807460
##########
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:
I don't understand why we have to treat TableFunctions specially -- the PR
descriptio says it is to avoid a crate dependency cycle, but I don't understand
why the same thing doesn't apply to Scalar and Aggregate functons
Mabe we just need to move a definition of TableFunction to datafusion-expr 🤔
But maybe that is not possible
--
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]