[fix](nereids)window expression's window frame may lost in NormalizeToSlot (#30378)
This commit is contained in:
@ -185,6 +185,9 @@ public interface NormalizeToSlot {
|
||||
}
|
||||
newChildren.add(newChild);
|
||||
}
|
||||
if (windowExpression.getWindowFrame().isPresent()) {
|
||||
newChildren.add(windowExpression.getWindowFrame().get());
|
||||
}
|
||||
return hasNewChildren ? windowExpression.withChildren(newChildren) : windowExpression;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user