-
-
Notifications
You must be signed in to change notification settings - Fork 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
fix: fix project pushdown for double projection contains count #11843
Conversation
@@ -29,6 +54,14 @@ pub(super) fn process_projection( | |||
// simply select the first column | |||
let (first_name, _) = input_schema.try_get_at_index(0)?; | |||
let expr = expr_arena.add(AExpr::Column(Arc::from(first_name.as_str()))); | |||
if !acc_projections.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure would it be more reasonable to clear acc_projections
and projected_names
directly here? Because we seem to be only concerned with the first input. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point. We could immediately move those to the "local" projection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, if we immediately move all acc_projections
to local projection
.
pl.LazyFrame({"x" : 1}).select(pl.count().alias("r")).select(pl.col("r")).collect()
Will panic durning build local_projections
as we push down pl.col("r")
to the first select
.
PanicException: called `Result::unwrap()` on an `Err` value: ColumnNotFound(ErrString("r"))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's leave it like this. It seems pretty clean now. :)
@@ -29,6 +54,14 @@ pub(super) fn process_projection( | |||
// simply select the first column | |||
let (first_name, _) = input_schema.try_get_at_index(0)?; | |||
let expr = expr_arena.add(AExpr::Column(Arc::from(first_name.as_str()))); | |||
if !acc_projections.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's leave it like this. It seems pretty clean now. :)
This fixes #11841.