jamxia155 commented on code in PR #14194:
URL: https://github.com/apache/datafusion/pull/14194#discussion_r1956618106


##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -559,12 +562,62 @@ pub fn from_table_scan(
     let table_schema = scan.source.schema().to_dfschema_ref()?;
     let base_schema = to_substrait_named_struct(&table_schema)?;
 
+    let mut filter_option = None;
+    let mut best_effort_filter_option = None;
+
+    if !scan.filters.is_empty() {
+        let mut full_filters = vec![];
+        let mut partial_filters = vec![];
+        let mut unsupported_filters = vec![];
+        let filter_refs: Vec<&Expr> = scan.filters.iter().collect();
+
+        if let Ok(results) = 
scan.source.supports_filters_pushdown(&filter_refs) {
+            scan.filters
+                .iter()
+                .zip(results.iter())
+                .for_each(|(x, res)| match res {
+                    TableProviderFilterPushDown::Exact => 
full_filters.push(x.clone()),
+                    TableProviderFilterPushDown::Inexact => {
+                        partial_filters.push(x.clone())
+                    }
+                    TableProviderFilterPushDown::Unsupported => {
+                        unsupported_filters.push(x.clone())
+                    }
+                });
+        }
+
+        let table_schema_qualified =

Review Comment:
   The `table_schema` above was not qualified with the table name and gave me 
errors when used in `handle_expr`.



-- 
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...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to