From d35249537894f045a72218cf1754fa0ec5b313f6 Mon Sep 17 00:00:00 2001 From: "D.B. Schwartz" <1689014+cisaacson@users.noreply.github.com> Date: Sun, 7 Apr 2024 14:09:52 -0600 Subject: [PATCH 01/10] Further refinement of the comment --- datafusion/core/src/datasource/provider.rs | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 9aac072ed4e2..a8943905a3e1 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -161,20 +161,34 @@ pub trait TableProvider: Sync + Send { /// Specify if DataFusion should provide filter expressions to the /// TableProvider to apply *during* the scan. /// - /// The return value must have one element for each filter expression passed - /// in. The value of each element indicates if the TableProvider can apply - /// that particular filter during the scan. - /// /// Some TableProviders can evaluate filters more efficiently than the /// `Filter` operator in DataFusion, for example by using an index. + /// + /// The return value must have one element for each filter expression passed + /// in. The value of each element indicates if the TableProvider can apply + /// that particular filter during the scan. The position in the return value + /// Vec corresponds to the expression in the `filters` input. One approach is to + /// allocate a result Vec equal to the size of the `filters` length, then + /// loop the `filters` array and indicate the proper level of support (or not) + /// for each individual filter expression according to the capabilities + /// of the TableProvider. /// - /// By default, returns [`Unsupported`] for all filters, meaning no filters + /// If this fn is not implemented by the TableProvider, by default + /// it returns [`Unsupported`] for all filters, meaning no filters /// will be provided to [`Self::scan`]. If the TableProvider can implement - /// filter pushdown, it should return either [`Exact`] or [`Inexact`]. + /// filter pushdown, it should return either [`Exact`] or [`Inexact`], if + /// the filter cannot be supported it should return [`Unsupported`] + /// for that element in the result Vec. As specified above, the result Vec + /// must be of the same size as the `filters` input length. /// + /// The values for each element of the result Vec is one of the following: + /// /// [`Unsupported`]: TableProviderFilterPushDown::Unsupported /// [`Exact`]: TableProviderFilterPushDown::Exact /// [`Inexact`]: TableProviderFilterPushDown::Inexact + /// + /// If the length of the result Vec does not match the `filters` input + /// an error will be thrown. fn supports_filters_pushdown( &self, filters: &[&Expr], From e19d6483f5fbb3bdb9b7f1fcea8acd9b0998a4b6 Mon Sep 17 00:00:00 2001 From: "D.B. Schwartz" <1689014+cisaacson@users.noreply.github.com> Date: Mon, 8 Apr 2024 07:34:43 -0600 Subject: [PATCH 02/10] Add code example example of how to support a filter --- datafusion/core/src/datasource/provider.rs | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index a8943905a3e1..2734b59a8ab8 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -167,12 +167,32 @@ pub trait TableProvider: Sync + Send { /// The return value must have one element for each filter expression passed /// in. The value of each element indicates if the TableProvider can apply /// that particular filter during the scan. The position in the return value - /// Vec corresponds to the expression in the `filters` input. One approach is to - /// allocate a result Vec equal to the size of the `filters` length, then - /// loop the `filters` array and indicate the proper level of support (or not) - /// for each individual filter expression according to the capabilities - /// of the TableProvider. - /// + /// Vec corresponds to the expression in the `filters` input. + /// + /// Here is an example of how this can be done: + /// + /// ``` + /// fn supports_filters_pushdown( + /// &self, + /// filters: &[&Expr],) -> Result> { + /// + /// let result_vec: Vec = Vec::with_capacity(&filters.len()); + /// for i in 0..filters.len() { + /// // Evaluate a filter + /// let filter = filters[i]; + /// + /// // Evaluate a filter to support here + /// if filter ... { + /// result_vec.push(TableProviderFilterPushDown::Exact); + /// } else { + /// result_vec.push(TableProviderFilterPushDown::Unsupported); + /// } + /// } + /// + /// Ok(result_vec) + /// } + /// ``` + /// /// If this fn is not implemented by the TableProvider, by default /// it returns [`Unsupported`] for all filters, meaning no filters /// will be provided to [`Self::scan`]. If the TableProvider can implement From 3566be756501ff50643537f2466db62a8dc76df8 Mon Sep 17 00:00:00 2001 From: cisaacson <1689014+cisaacson@users.noreply.github.com> Date: Mon, 8 Apr 2024 12:59:18 -0600 Subject: [PATCH 03/10] Update supports_filters_pushdown example so that it compiles --- datafusion/core/src/datasource/provider.rs | 35 ++++++++++++++++------ 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 2734b59a8ab8..e5e08c67d0fb 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -171,21 +171,38 @@ pub trait TableProvider: Sync + Send { /// /// Here is an example of how this can be done: /// - /// ``` + /// ```rust + /// use datafusion::error::{Result, DataFusionError}; + /// use datafusion_expr::{Expr, TableProviderFilterPushDown}; + /// /// fn supports_filters_pushdown( /// &self, /// filters: &[&Expr],) -> Result> { /// - /// let result_vec: Vec = Vec::with_capacity(&filters.len()); + /// let mut result_vec: Vec = Vec::with_capacity(&filters.len()); + /// /// for i in 0..filters.len() { - /// // Evaluate a filter - /// let filter = filters[i]; + /// let expr = *filters[i]; /// - /// // Evaluate a filter to support here - /// if filter ... { - /// result_vec.push(TableProviderFilterPushDown::Exact); - /// } else { - /// result_vec.push(TableProviderFilterPushDown::Unsupported); + /// match expr { + /// Expr::Between(between_expr) => { + /// match between_expr.expr.try_into_col().ok() { + /// Some(column) => { + /// let column_name = column.name; + /// if column_name = "c1".to_string() { + /// result_vec.push(TableProviderFilterPushDown::Exact); + /// } else { + /// result_vec.push(TableProviderFilterPushDown::Unsupported); + /// } + /// } + /// None => { + /// return Err(DataFusionError::Execution(format!("Could not get column. between_expr: {:?}", between_expr))); + /// } + /// } + /// } + /// _ => { + /// result_vec.push(TableProviderFilterPushDown::Unsupported); + /// } /// } /// } /// From 9fc6ce48d2c89b0c8cf9a90d07233ef8d8dc886d Mon Sep 17 00:00:00 2001 From: cisaacson <1689014+cisaacson@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:28:50 -0600 Subject: [PATCH 04/10] Add comments to example code in supports_filters_pushdown doc --- datafusion/core/src/datasource/provider.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index e5e08c67d0fb..30783aec749a 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -185,18 +185,23 @@ pub trait TableProvider: Sync + Send { /// let expr = *filters[i]; /// /// match expr { + /// // This example is only evaluting one type of expr and one column. /// Expr::Between(between_expr) => { /// match between_expr.expr.try_into_col().ok() { /// Some(column) => { /// let column_name = column.name; /// if column_name = "c1".to_string() { + /// // Use Exact if you can ensure proper a proper distinct set from the pushdown + /// // result, with unique rows, otherwise use Inexact. In the latter case DataFusion will + /// // provide the distinct functionality which is less performant. /// result_vec.push(TableProviderFilterPushDown::Exact); /// } else { /// result_vec.push(TableProviderFilterPushDown::Unsupported); /// } /// } /// None => { - /// return Err(DataFusionError::Execution(format!("Could not get column. between_expr: {:?}", between_expr))); + /// // If there is no column expr in the query an error is thrown. + /// result_vec.push(TableProviderFilterPushDown::Unsupported); /// } /// } /// } From 43c5eb332c304dddc33afe299109e884101a542d Mon Sep 17 00:00:00 2001 From: cisaacson <1689014+cisaacson@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:14:48 -0600 Subject: [PATCH 05/10] Change example to use functional style --- datafusion/core/src/datasource/provider.rs | 51 ++++++++++------------ 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 30783aec749a..62142939ee5b 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -175,43 +175,40 @@ pub trait TableProvider: Sync + Send { /// use datafusion::error::{Result, DataFusionError}; /// use datafusion_expr::{Expr, TableProviderFilterPushDown}; /// - /// fn supports_filters_pushdown( - /// &self, - /// filters: &[&Expr],) -> Result> { - /// + /// // Override the supports_filters_pushdown to evaluate which expressions + /// // to accept as pushdown predicates. + /// fn supports_filters_pushdown(&self, filters: &[&Expr]) -> Result> { + /// /// let mut result_vec: Vec = Vec::with_capacity(&filters.len()); - /// + /// + /// // Process each filter /// for i in 0..filters.len() { /// let expr = *filters[i]; - /// - /// match expr { - /// // This example is only evaluting one type of expr and one column. + /// + /// let table_provider_filter_pushdown = match expr { + /// // This example only supports a between expr with a single column name. /// Expr::Between(between_expr) => { - /// match between_expr.expr.try_into_col().ok() { - /// Some(column) => { - /// let column_name = column.name; - /// if column_name = "c1".to_string() { - /// // Use Exact if you can ensure proper a proper distinct set from the pushdown - /// // result, with unique rows, otherwise use Inexact. In the latter case DataFusion will - /// // provide the distinct functionality which is less performant. - /// result_vec.push(TableProviderFilterPushDown::Exact); + /// between_expr.expr.try_into_col() + /// .map(|column| { + /// if column.name = "c1".to_string() { + /// TableProviderFilterPushDown::Exact /// } else { - /// result_vec.push(TableProviderFilterPushDown::Unsupported); + /// TableProviderFilterPushDown::Unsupported /// } - /// } - /// None => { - /// // If there is no column expr in the query an error is thrown. - /// result_vec.push(TableProviderFilterPushDown::Unsupported); - /// } + /// }) + /// // If there is no column in the expr set the filter to unsupported. + /// .unwrap_or(TableProviderFilterPushDown::Unsupported); /// } + /// _ => { + /// // For all other cases return Unsupported. + /// TableProviderFilterPushDown::Unsupported /// } - /// _ => { - /// result_vec.push(TableProviderFilterPushDown::Unsupported); - /// } - /// } + /// }; + /// result_vec.push(table_provider_filter_pushdown); /// } - /// + /// /// Ok(result_vec) + /// /// } /// ``` /// From fb483f969fdbc01bfe4e4a6eb2c14aaaa0d2bf5a Mon Sep 17 00:00:00 2001 From: cisaacson <1689014+cisaacson@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:37:35 -0400 Subject: [PATCH 06/10] Fixed several issues with the supports_filters_pushdown doc; still need all required TableProvider impl fns --- datafusion/core/src/datasource/provider.rs | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 62142939ee5b..85e86816bde9 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -172,17 +172,22 @@ pub trait TableProvider: Sync + Send { /// Here is an example of how this can be done: /// /// ```rust + /// use datafusion::datasource::TableProvider; /// use datafusion::error::{Result, DataFusionError}; /// use datafusion_expr::{Expr, TableProviderFilterPushDown}; /// - /// // Override the supports_filters_pushdown to evaluate which expressions - /// // to accept as pushdown predicates. - /// fn supports_filters_pushdown(&self, filters: &[&Expr]) -> Result> { + /// struct TestDataSource {} + /// + /// impl TableProvider for TestDataSource { + /// + /// // Override the supports_filters_pushdown to evaluate which expressions + /// // to accept as pushdown predicates. + /// fn supports_filters_pushdown(&self, filters: &[&Expr]) -> Result> { /// - /// let mut result_vec: Vec = Vec::with_capacity(&filters.len()); + /// let mut result_vec: Vec = Vec::with_capacity(filters.len()); /// - /// // Process each filter - /// for i in 0..filters.len() { + /// // Process each filter + /// for i in 0..filters.len() { /// let expr = *filters[i]; /// /// let table_provider_filter_pushdown = match expr { @@ -190,25 +195,26 @@ pub trait TableProvider: Sync + Send { /// Expr::Between(between_expr) => { /// between_expr.expr.try_into_col() /// .map(|column| { - /// if column.name = "c1".to_string() { + /// if column.name == "c1".to_string() { /// TableProviderFilterPushDown::Exact /// } else { /// TableProviderFilterPushDown::Unsupported /// } /// }) /// // If there is no column in the expr set the filter to unsupported. - /// .unwrap_or(TableProviderFilterPushDown::Unsupported); + /// .unwrap_or(TableProviderFilterPushDown::Unsupported) /// } - /// _ => { - /// // For all other cases return Unsupported. - /// TableProviderFilterPushDown::Unsupported - /// } - /// }; - /// result_vec.push(table_provider_filter_pushdown); - /// } + /// _ => { + /// // For all other cases return Unsupported. + /// TableProviderFilterPushDown::Unsupported + /// } + /// }; + /// result_vec.push(table_provider_filter_pushdown); + /// } /// - /// Ok(result_vec) + /// Ok(result_vec) /// + /// } /// } /// ``` /// From 6c08622f50fa5eef485e58ffa001a240687e1549 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 10 Apr 2024 07:21:50 -0400 Subject: [PATCH 07/10] cargo fmt --- datafusion/core/src/datasource/provider.rs | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 85e86816bde9..42b5218f04a6 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -163,24 +163,24 @@ pub trait TableProvider: Sync + Send { /// /// Some TableProviders can evaluate filters more efficiently than the /// `Filter` operator in DataFusion, for example by using an index. - /// + /// /// The return value must have one element for each filter expression passed /// in. The value of each element indicates if the TableProvider can apply /// that particular filter during the scan. The position in the return value - /// Vec corresponds to the expression in the `filters` input. - /// + /// Vec corresponds to the expression in the `filters` input. + /// /// Here is an example of how this can be done: - /// + /// /// ```rust /// use datafusion::datasource::TableProvider; /// use datafusion::error::{Result, DataFusionError}; /// use datafusion_expr::{Expr, TableProviderFilterPushDown}; - /// + /// /// struct TestDataSource {} - /// + /// /// impl TableProvider for TestDataSource { - /// - /// // Override the supports_filters_pushdown to evaluate which expressions + /// + /// // Override the supports_filters_pushdown to evaluate which expressions /// // to accept as pushdown predicates. /// fn supports_filters_pushdown(&self, filters: &[&Expr]) -> Result> { /// @@ -217,21 +217,21 @@ pub trait TableProvider: Sync + Send { /// } /// } /// ``` - /// - /// If this fn is not implemented by the TableProvider, by default + /// + /// If this fn is not implemented by the TableProvider, by default /// it returns [`Unsupported`] for all filters, meaning no filters /// will be provided to [`Self::scan`]. If the TableProvider can implement - /// filter pushdown, it should return either [`Exact`] or [`Inexact`], if + /// filter pushdown, it should return either [`Exact`] or [`Inexact`], if /// the filter cannot be supported it should return [`Unsupported`] /// for that element in the result Vec. As specified above, the result Vec /// must be of the same size as the `filters` input length. /// /// The values for each element of the result Vec is one of the following: - /// + /// /// [`Unsupported`]: TableProviderFilterPushDown::Unsupported /// [`Exact`]: TableProviderFilterPushDown::Exact /// [`Inexact`]: TableProviderFilterPushDown::Inexact - /// + /// /// If the length of the result Vec does not match the `filters` input /// an error will be thrown. fn supports_filters_pushdown( From a9f611ff24c6b504af764490b09c69ab3bb5ef92 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 10 Apr 2024 07:37:07 -0400 Subject: [PATCH 08/10] Update example so it compiles and add headings --- datafusion/core/src/datasource/provider.rs | 114 +++++++++++---------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 42b5218f04a6..6fad9c79df4b 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -164,76 +164,80 @@ pub trait TableProvider: Sync + Send { /// Some TableProviders can evaluate filters more efficiently than the /// `Filter` operator in DataFusion, for example by using an index. /// - /// The return value must have one element for each filter expression passed - /// in. The value of each element indicates if the TableProvider can apply - /// that particular filter during the scan. The position in the return value - /// Vec corresponds to the expression in the `filters` input. + /// # Parameters and Return Value /// - /// Here is an example of how this can be done: + /// The return `Vec` must have one element for each element of the `filters` + /// argument. The value of each element indicates if the TableProvider can + /// apply the corresponding filter during the scan. The position in the return + /// value corresponds to the expression in the `filters` parameter. /// - /// ```rust - /// use datafusion::datasource::TableProvider; - /// use datafusion::error::{Result, DataFusionError}; - /// use datafusion_expr::{Expr, TableProviderFilterPushDown}; + /// If the length of the resulting `Vec` does not match the `filters` input + /// an error will be thrown. + /// + /// Each element in the resulting `Vec` is one of the following: + /// * [`Exact`] or [`Inexact`]: The TableProvider can apply the filter + /// during scan + /// * [`Unsupported`]: The TableProvider cannot apply the filter during scan + /// + /// By default, this function returns [`Unsupported`] for all filters, + /// meaning no filters will be provided to [`Self::scan`]. + /// + /// [`Unsupported`]: TableProviderFilterPushDown::Unsupported + /// [`Exact`]: TableProviderFilterPushDown::Exact + /// [`Inexact`]: TableProviderFilterPushDown::Inexact + /// # Example /// + /// ```rust + /// # use std::any::Any; /// # + /// # use std::sync::Arc; + /// # use arrow_schema::SchemaRef; + /// # use async_trait::async_trait; + /// # use datafusion::datasource::TableProvider; + /// # use datafusion::error::{Result, DataFusionError}; + /// # use datafusion::execution::context::SessionState; + /// # use datafusion_expr::{Expr, TableProviderFilterPushDown, TableType}; + /// # use datafusion_physical_plan::ExecutionPlan; + /// // Define a struct that implements the TableProvider trait /// struct TestDataSource {} /// + /// #[async_trait] /// impl TableProvider for TestDataSource { - /// + /// # fn as_any(&self) -> &dyn Any { todo!() } + /// # fn schema(&self) -> SchemaRef { todo!() } + /// # fn table_type(&self) -> TableType { todo!() } + /// # async fn scan(&self, s: &SessionState, p: Option<&Vec>, f: &[Expr], l: Option) -> Result> { + /// todo!() + /// # } /// // Override the supports_filters_pushdown to evaluate which expressions /// // to accept as pushdown predicates. /// fn supports_filters_pushdown(&self, filters: &[&Expr]) -> Result> { - /// - /// let mut result_vec: Vec = Vec::with_capacity(filters.len()); - /// /// // Process each filter - /// for i in 0..filters.len() { - /// let expr = *filters[i]; - /// - /// let table_provider_filter_pushdown = match expr { - /// // This example only supports a between expr with a single column name. + /// let support: Vec<_> = filters.iter().map(|expr| { + /// match expr { + /// // This example only supports a between expr with a single column named "c1". /// Expr::Between(between_expr) => { - /// between_expr.expr.try_into_col() - /// .map(|column| { - /// if column.name == "c1".to_string() { - /// TableProviderFilterPushDown::Exact - /// } else { - /// TableProviderFilterPushDown::Unsupported - /// } - /// }) - /// // If there is no column in the expr set the filter to unsupported. - /// .unwrap_or(TableProviderFilterPushDown::Unsupported) - /// } - /// _ => { - /// // For all other cases return Unsupported. - /// TableProviderFilterPushDown::Unsupported - /// } - /// }; - /// result_vec.push(table_provider_filter_pushdown); + /// between_expr.expr + /// .try_into_col() + /// .map(|column| { + /// if column.name == "c1".to_string() { + /// TableProviderFilterPushDown::Exact + /// } else { + /// TableProviderFilterPushDown::Unsupported + /// } + /// }) + /// // If there is no column in the expr set the filter to unsupported. + /// .unwrap_or(TableProviderFilterPushDown::Unsupported) + /// } + /// _ => { + /// // For all other cases return Unsupported. + /// TableProviderFilterPushDown::Unsupported + /// } /// } - /// - /// Ok(result_vec) - /// + /// }).collect(); + /// Ok(support) /// } /// } /// ``` - /// - /// If this fn is not implemented by the TableProvider, by default - /// it returns [`Unsupported`] for all filters, meaning no filters - /// will be provided to [`Self::scan`]. If the TableProvider can implement - /// filter pushdown, it should return either [`Exact`] or [`Inexact`], if - /// the filter cannot be supported it should return [`Unsupported`] - /// for that element in the result Vec. As specified above, the result Vec - /// must be of the same size as the `filters` input length. - /// - /// The values for each element of the result Vec is one of the following: - /// - /// [`Unsupported`]: TableProviderFilterPushDown::Unsupported - /// [`Exact`]: TableProviderFilterPushDown::Exact - /// [`Inexact`]: TableProviderFilterPushDown::Inexact - /// - /// If the length of the result Vec does not match the `filters` input - /// an error will be thrown. fn supports_filters_pushdown( &self, filters: &[&Expr], From 41317d646d2b4cfa3c7b4977ee318d9fc45c4799 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 10 Apr 2024 07:39:31 -0400 Subject: [PATCH 09/10] clean --- datafusion/core/src/datasource/provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index 6fad9c79df4b..cf87a5223d7b 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -188,7 +188,7 @@ pub trait TableProvider: Sync + Send { /// # Example /// /// ```rust - /// # use std::any::Any; /// # + /// # use std::any::Any; /// # use std::sync::Arc; /// # use arrow_schema::SchemaRef; /// # use async_trait::async_trait; From 7d7ae24c75f18e9d37489e418f896cdff8eb7ac0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 10 Apr 2024 07:41:11 -0400 Subject: [PATCH 10/10] remove to_string() --- datafusion/core/src/datasource/provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/src/datasource/provider.rs b/datafusion/core/src/datasource/provider.rs index cf87a5223d7b..100011952b3b 100644 --- a/datafusion/core/src/datasource/provider.rs +++ b/datafusion/core/src/datasource/provider.rs @@ -219,7 +219,7 @@ pub trait TableProvider: Sync + Send { /// between_expr.expr /// .try_into_col() /// .map(|column| { - /// if column.name == "c1".to_string() { + /// if column.name == "c1" { /// TableProviderFilterPushDown::Exact /// } else { /// TableProviderFilterPushDown::Unsupported