[Bug](materialized-view) fix materialized-view query match not consider with order by elements (#18384)

fix materialized-view query match not consider with order by elements
This commit is contained in:
Pxl
2023-04-07 11:11:18 +08:00
committed by GitHub
parent 2b662ac26b
commit 267b690dad
3 changed files with 16 additions and 0 deletions

View File

@ -230,6 +230,10 @@ public class SelectStmt extends QueryStmt {
if (havingClauseAfterAnaylzed != null) {
exprs.add(havingClauseAfterAnaylzed);
}
if (orderByElementsAfterAnalyzed != null) {
exprs.addAll(orderByElementsAfterAnalyzed.stream().map(orderByElement -> orderByElement.getExpr())
.collect(Collectors.toList()));
}
return exprs;
}