[fix](Nereids) topn arg check is not compatible with legacy planner (#16105)
This commit is contained in:
@ -77,12 +77,12 @@ public class TopN extends AggregateFunction
|
||||
|
||||
@Override
|
||||
public void checkLegalityBeforeTypeCoercion() {
|
||||
if (!getArgument(1).isConstant() || !getArgumentType(1).isIntegerType()) {
|
||||
if (!getArgument(1).isConstant() || !getArgumentType(1).isIntegerLikeType()) {
|
||||
throw new AnalysisException(
|
||||
"topn requires second parameter must be a constant Integer Type: " + this.toSql());
|
||||
}
|
||||
if (arity() == 3) {
|
||||
if (!getArgument(2).isConstant() || !getArgumentType(2).isIntegerType()) {
|
||||
if (!getArgument(2).isConstant() || !getArgumentType(2).isIntegerLikeType()) {
|
||||
throw new AnalysisException(
|
||||
"topn requires the third parameter must be a constant Integer Type: " + this.toSql());
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ public abstract class DataType implements AbstractDataType {
|
||||
}
|
||||
|
||||
public boolean isIntegerLikeType() {
|
||||
return this instanceof IntegralType;
|
||||
return this instanceof IntegralType && !(this instanceof LargeIntType);
|
||||
}
|
||||
|
||||
public boolean isTinyIntType() {
|
||||
|
||||
Reference in New Issue
Block a user