returnString commented on a change in pull request #8917:
URL: https://github.com/apache/arrow/pull/8917#discussion_r543494569



##########
File path: rust/datafusion/src/datasource/datasource.rs
##########
@@ -34,6 +35,23 @@ pub struct Statistics {
     pub total_byte_size: Option<usize>,
 }
 
+/// Indicates whether and how a filter expression can be handled by a
+/// TableProvider for table scans.
+#[derive(Debug, Clone)]
+pub enum TableProviderFilterPushDown {
+    /// The expression cannot be used by the provider.
+    Unsupported,
+    /// The expression can be used to help minimise the data retrieved,
+    /// but the provider cannot guarantee that all returned tuples

Review comment:
       This result is used to drive the logical plan optimisation. Returning 
`Unsupported` _or_ `Inexact` will both result in the original filter node being 
preserved in the plan (only `Exact` can provide optimisation guarantees that 
the post-hoc filtering is unecessary) but `Inexact` means that the filter expr 
in question will be passed to `TableProvider::scan` when creating the execution 
plan, whereas `Unsupported` means the provider can do nothing useful with the 
expr at all (relevant code is 
[here](https://github.com/apache/arrow/pull/8917/files#diff-5f6ab9edcef3a4b9a8eb75f641ac0930cdbae92156f056fea400e0c58218a094R354-R369)).




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to