Skip to content

Commit

Permalink
[fix](nereids)window expression's window frame may lost in NormalizeT…
Browse files Browse the repository at this point in the history
…oSlot (#30378)
  • Loading branch information
starocean999 authored Jan 29, 2024
1 parent 289bdd4 commit b3e7204
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public Expression visitWindow(WindowExpression windowExpression,
}
newChildren.add(newChild);
}
if (windowExpression.getWindowFrame().isPresent()) {
newChildren.add(windowExpression.getWindowFrame().get());
}
return hasNewChildren ? windowExpression.withChildren(newChildren) : windowExpression;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ suite("agg_window_project") {

order_qt_select4 """select a, c, sum(sum(b)) over(partition by c order by c rows between unbounded preceding and current row) from test_window_table2 group by a, c having a > 1;"""

explain {
sql("select a, c, sum(sum(b)) over(partition by c order by c rows between unbounded preceding and current row) from test_window_table2 group by a, c having a > 1;")
contains "ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW"
}

sql "DROP TABLE IF EXISTS test_window_table2;"
}

0 comments on commit b3e7204

Please sign in to comment.