[fix](planner)only forbid literal value in AnalyticExpr's order by list (#21819)

* [fix](planner)only forbid literal value in AnalyticExpr's order by list
This commit is contained in:
starocean999
2023-07-19 09:40:55 +08:00
committed by GitHub
parent d349c955f0
commit 5b043a980e
3 changed files with 41 additions and 2 deletions

View File

@ -465,7 +465,7 @@ public class AnalyticExpr extends Expr {
type = getFnCall().getType();
for (Expr e : partitionExprs) {
if (e.isConstant()) {
if (e.isLiteral()) {
throw new AnalysisException(
"Expressions in the PARTITION BY clause must not be constant: "
+ e.toSql() + " (in " + toSql() + ")");
@ -473,7 +473,7 @@ public class AnalyticExpr extends Expr {
}
for (OrderByElement e : orderByElements) {
if (e.getExpr().isConstant()) {
if (e.getExpr().isLiteral()) {
throw new AnalysisException(
"Expressions in the ORDER BY clause must not be constant: "
+ e.getExpr().toSql() + " (in " + toSql() + ")");