bubulalabu commented on code in PR #18022:
URL: https://github.com/apache/datafusion/pull/18022#discussion_r2443326629
##########
datafusion/catalog/src/schema.rs:
##########
@@ -88,4 +88,45 @@ pub trait SchemaProvider: Debug + Sync + Send {
/// Returns true if table exist in the schema provider, false otherwise.
fn table_exist(&self, name: &str) -> bool;
+
+ /// Retrieves the list of available table function names in this schema.
+ fn udtf_names(&self) -> Vec<String> {
+ vec![]
+ }
+
+ /// Retrieves a specific table function from the schema by name, if it
exists,
+ /// otherwise returns `None`.
+ fn udtf(&self, name: &str) -> Result<Option<Arc<TableFunction>>> {
+ let _ = name; // suppress unused warning
+ Ok(None)
+ }
+
+ /// If supported by the implementation, adds a new table function named
`name` to
+ /// this schema.
+ ///
+ /// If a table function of the same name was already registered, returns
"Table
+ /// function already exists" error.
+ #[allow(unused_variables)]
Review Comment:
done
##########
datafusion/catalog/src/schema.rs:
##########
@@ -88,4 +88,45 @@ pub trait SchemaProvider: Debug + Sync + Send {
/// Returns true if table exist in the schema provider, false otherwise.
fn table_exist(&self, name: &str) -> bool;
+
+ /// Retrieves the list of available table function names in this schema.
+ fn udtf_names(&self) -> Vec<String> {
+ vec![]
+ }
+
+ /// Retrieves a specific table function from the schema by name, if it
exists,
+ /// otherwise returns `None`.
+ fn udtf(&self, name: &str) -> Result<Option<Arc<TableFunction>>> {
+ let _ = name; // suppress unused warning
+ Ok(None)
+ }
+
+ /// If supported by the implementation, adds a new table function named
`name` to
+ /// this schema.
+ ///
+ /// If a table function of the same name was already registered, returns
"Table
+ /// function already exists" error.
+ #[allow(unused_variables)]
+ fn register_udtf(
+ &self,
+ name: String,
+ function: Arc<TableFunction>,
+ ) -> Result<Option<Arc<TableFunction>>> {
+ exec_err!("schema provider does not support registering table
functions")
+ }
+
+ /// If supported by the implementation, removes the `name` table function
from this
+ /// schema and returns the previously registered [`TableFunction`], if any.
+ ///
+ /// If no `name` table function exists, returns Ok(None).
+ #[allow(unused_variables)]
Review Comment:
done
--
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]