Skip to content

Commit

Permalink
empty input schema
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Jan 29, 2025
1 parent 1096ab1 commit d74d2a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/polars-stream/src/physical_plan/lower_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,14 @@ pub fn build_length_preserving_select_stream(
let already_length_preserving = exprs
.iter()
.any(|expr| is_length_preserving_ctx(expr.node(), &mut ctx));
if exprs.is_empty() || already_length_preserving {
let input_schema = &ctx.phys_sm[input.node].output_schema;
if exprs.is_empty() || input_schema.is_empty() || already_length_preserving {
return build_select_stream_with_ctx(input, exprs, &mut ctx);
}

// Hacky work-around: append an input column with a temporary name, but
// remove it from the final selector. This should ensure scalars gets zipped
// back to the input to broadcast them.
let input_schema = &ctx.phys_sm[input.node].output_schema;
let tmp_name = unique_column_name();
let first_col = ctx.expr_arena.add(AExpr::Column(
input_schema.iter_names_cloned().next().unwrap(),
Expand Down

0 comments on commit d74d2a2

Please sign in to comment.