Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/barak1412/polars into expos…
Browse files Browse the repository at this point in the history
…e_regex_escape
barak1412 committed Oct 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 622d233 + dae6cd9 commit 2d29893
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions crates/polars-expr/src/expressions/alias.rs
Original file line number Diff line number Diff line change
@@ -59,6 +59,10 @@ impl PhysicalExpr for AliasExpr {
))
}

fn is_literal(&self) -> bool {
self.physical_expr.is_literal()
}

fn is_scalar(&self) -> bool {
self.physical_expr.is_scalar()
}
10 changes: 7 additions & 3 deletions crates/polars-mem-engine/src/planner/lp.rs
Original file line number Diff line number Diff line change
@@ -374,16 +374,20 @@ fn create_physical_plan_impl(
POOL.current_num_threads() > expr.len(),
state.expr_depth,
);

let streamable =
options.should_broadcast && all_streamable(&expr, expr_arena, Context::Default);
let phys_expr = create_physical_expressions_from_irs(
&expr,
Context::Default,
expr_arena,
&input_schema,
&mut state,
)?;

let streamable = options.should_broadcast && all_streamable(&expr, expr_arena, Context::Default)
// If all columns are literal we would get a 1 row per thread.
&& !phys_expr.iter().all(|p| {
p.is_literal()
});

Ok(Box::new(executors::ProjectionExec {
input,
expr: phys_expr,

0 comments on commit 2d29893

Please sign in to comment.