liukun4515 commented on a change in pull request #1288: URL: https://github.com/apache/arrow-datafusion/pull/1288#discussion_r748787566
########## File path: datafusion/src/catalog/schema.rs ########## @@ -101,4 +115,70 @@ impl SchemaProvider for MemorySchemaProvider { let mut tables = self.tables.write().unwrap(); Ok(tables.remove(name)) } + + fn table_exist(&self, name: &str) -> bool { + let tables = self.tables.read().unwrap(); + tables.contains_key(name) + } +} + +#[cfg(test)] +mod tests { + use crate::arrow::datatypes::SchemaRef; + use crate::catalog::schema::{MemorySchemaProvider, SchemaProvider}; + use crate::datasource::TableProvider; + use crate::logical_plan::Expr; + use crate::physical_plan::ExecutionPlan; + use std::any::Any; + use std::sync::Arc; + + use async_trait::async_trait; + + #[tokio::test] + async fn test_mem_provider() { + struct TestTableProvider(); Review comment: i just refer to [this](https://github.com/apache/arrow-datafusion/blob/7824a8d74093374da8a4f040d23a81b8436b7380/datafusion/src/execution/context.rs#L3469). Thanks for your comments, the empty table is better. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org