You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/10/23 11:51:52 UTC

[GitHub] [arrow-datafusion] Jimexist opened a new issue #1170: apply constant folding to values logical plan

Jimexist opened a new issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170


   I suspect it is not likely to matter, but constant folding could be applied to the `Expr`s in `values`. As written this code will not apply constant folding to those expressions
   
   _Originally posted by @alamb in https://github.com/apache/arrow-datafusion/pull/1165#discussion_r734958657_


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

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



[GitHub] [arrow-datafusion] viirya edited a comment on issue #1170: apply constant folding to LogicalPlan::Values

Posted by GitBox <gi...@apache.org>.
viirya edited a comment on issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170#issuecomment-977598633


   Hmm, I actually saw `LogicalPlan::Values` among the logical plans in constant folding optimizer rule now. Is this already resolved?


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

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



[GitHub] [arrow-datafusion] viirya commented on issue #1170: apply constant folding to LogicalPlan::Values

Posted by GitBox <gi...@apache.org>.
viirya commented on issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170#issuecomment-977609931


   Ran a test:
   
   ```rust
       #[test]
       fn optimize_plan_support_values() -> Result<()> {
           let expr1 = Expr::BinaryExpr {
               left: Box::new(lit(1)),
               op: Operator::Plus,
               right: Box::new(lit(2)),
           };
           let expr2 = Expr::BinaryExpr {
               left: Box::new(lit(2)),
               op: Operator::Minus,
               right: Box::new(lit(1)),
           };
           let values = vec![vec![expr1, expr2]];
           let plan = LogicalPlanBuilder::values(values)?.build()?;
   
           let expected = "\
           Values: (Int32(3), Int32(1))";
   
           assert_optimized_plan_eq(&plan, expected);
           Ok(())
       }
   ```
   
   
   Looks it already did constant folding?
   
   Maybe we just need to add the test?


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

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



[GitHub] [arrow-datafusion] viirya commented on issue #1170: apply constant folding to LogicalPlan::Values

Posted by GitBox <gi...@apache.org>.
viirya commented on issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170#issuecomment-977598633


   Hmm, I actually saw `LogicalPlan::Values` in constant folding optimizer rule now. Is this already resolved?


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

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



[GitHub] [arrow-datafusion] alamb closed issue #1170: apply constant folding to LogicalPlan::Values

Posted by GitBox <gi...@apache.org>.
alamb closed issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170


   


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

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



[GitHub] [arrow-datafusion] alamb commented on issue #1170: apply constant folding to LogicalPlan::Values

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #1170:
URL: https://github.com/apache/arrow-datafusion/issues/1170#issuecomment-978331599


   Thanks @viirya  -- yes I think the general purpose constant folding implementation we have now should handle the Values. Thanks for the test !


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

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