[fix](nereids)window expression's window frame may lost in NormalizeToSlot (#30378)

This commit is contained in:
starocean999
2024-01-29 16:45:35 +08:00
committed by yiguolei
parent 036e17dcb0
commit e36f390134
2 changed files with 8 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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;"
}