jackwener commented on code in PR #4650:
URL: https://github.com/apache/arrow-datafusion/pull/4650#discussion_r1049760630


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -1327,9 +1327,9 @@ impl SubqueryAlias {
 #[derive(Clone)]
 pub struct Filter {
     /// The predicate expression, which must have Boolean type.
-    predicate: Expr,
+    pub predicate: Expr,
     /// The incoming logical plan
-    input: Arc<LogicalPlan>,
+    pub input: Arc<LogicalPlan>,

Review Comment:
   pub them because I need pattern-match in rules.
   
   Discussion about it in #4464.
   
   cc @alamb @andygrove @tustvold .



##########
datafusion/optimizer/src/eliminate_filter.rs:
##########
@@ -40,176 +41,144 @@ impl OptimizerRule for EliminateFilter {
     fn try_optimize(
         &self,
         plan: &LogicalPlan,
-        optimizer_config: &mut OptimizerConfig,
+        _optimizer_config: &mut OptimizerConfig,
     ) -> Result<Option<LogicalPlan>> {
-        let predicate_and_input = match plan {
-            LogicalPlan::Filter(filter) => match filter.predicate() {
-                Expr::Literal(ScalarValue::Boolean(Some(v))) => {
-                    Some((*v, filter.input()))
+        match plan {
+            LogicalPlan::Filter(Filter {
+                predicate: Expr::Literal(ScalarValue::Boolean(Some(v))),
+                input,
+            }) => {

Review Comment:
   Nested Pattern-match here, so I make filter public



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

Reply via email to