Skip to content

Commit

Permalink
make alias condition more restrictive
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzwang committed Oct 4, 2024
1 parent aabd04e commit 6d6490b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,13 @@ fn try_optimize_project(
let aliased_projection_exprs = projection
.projection
.iter()
.map(|e| e.alias(e.name()))
.map(|e| {
if has_stateful_udf(e) && !matches!(e.as_ref(), Expr::Alias(..)) {
e.alias(e.name())
} else {
e.clone()
}
})
.collect();

let aliased_projection = Project::try_new(projection.input.clone(), aliased_projection_exprs)?;
Expand Down

0 comments on commit 6d6490b

Please sign in to comment.