-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apply constant folding to LogicalPlan::Values
#1170
Comments
alamb
changed the title
apply constant folding to values logical plan
apply constant folding to LogivalPlan::Values
Oct 25, 2021
alamb
changed the title
apply constant folding to LogivalPlan::Values
apply constant folding to LogicalPlan::Values
Oct 25, 2021
Hmm, I actually saw |
Ran a test: #[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? |
Thanks @viirya -- yes I think the general purpose constant folding implementation we have now should handle the Values. Thanks for the test ! |
alamb
changed the title
apply constant folding to LogicalPlan::Values
apply constant folding to Feb 10, 2022
LogicalPlan::Values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suspect it is not likely to matter, but constant folding could be applied to the
Expr
s invalues
. As written this code will not apply constant folding to those expressionsOriginally posted by @alamb in #1165 (comment)
The text was updated successfully, but these errors were encountered: