alamb commented on code in PR #3175:
URL: https://github.com/apache/arrow-datafusion/pull/3175#discussion_r946574953


##########
datafusion/optimizer/src/eliminate_filter.rs:
##########
@@ -183,4 +183,33 @@ mod tests {
             \n    TableScan: test";
         assert_optimized_plan_eq(&plan, expected);
     }
+
+    #[test]
+    fn fliter_from_subquery() {
+        // SELECT a FROM (SELECT a FROM test WHERE FALSE) WHERE TRUE
+
+        let false_filter = Expr::Literal(ScalarValue::Boolean(Some(false)));
+        let table_scan = test_table_scan().unwrap();
+        let plan1 = LogicalPlanBuilder::from(table_scan.clone())
+            .project(vec![col("a")])
+            .unwrap()
+            .filter(false_filter)
+            .unwrap()
+            .build()
+            .unwrap();
+
+        let true_filter = Expr::Literal(ScalarValue::Boolean(Some(true)));

Review Comment:
   ```suggestion
           let true_filter = lit(true);
   ```



##########
datafusion/optimizer/src/eliminate_filter.rs:
##########
@@ -183,4 +183,33 @@ mod tests {
             \n    TableScan: test";
         assert_optimized_plan_eq(&plan, expected);
     }
+
+    #[test]
+    fn fliter_from_subquery() {
+        // SELECT a FROM (SELECT a FROM test WHERE FALSE) WHERE TRUE
+
+        let false_filter = Expr::Literal(ScalarValue::Boolean(Some(false)));

Review Comment:
   ```suggestion
           let false_filter = lit(false);
   ```



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