[fix](Nereids) make the type of the first parameter in window_funnel is intergerLike (#15810)

This commit is contained in:
谢健
2023-01-12 11:53:28 +08:00
committed by GitHub
parent b86e781727
commit 39697bb83e
4 changed files with 56 additions and 1 deletions

View File

@ -74,7 +74,7 @@ public class WindowFunnel extends AggregateFunction
@Override
public void checkLegalityBeforeTypeCoercion() {
String functionName = getName();
if (!getArgumentType(0).isIntegerType()) {
if (!getArgumentType(0).isIntegerLikeType()) {
throw new AnalysisException("The window params of " + functionName + " function must be integer");
}
if (!getArgumentType(1).isStringLikeType()) {

View File

@ -29,6 +29,7 @@ import org.apache.doris.nereids.trees.expressions.literal.Literal;
import org.apache.doris.nereids.trees.expressions.literal.SmallIntLiteral;
import org.apache.doris.nereids.types.coercion.AbstractDataType;
import org.apache.doris.nereids.types.coercion.CharacterType;
import org.apache.doris.nereids.types.coercion.IntegralType;
import org.apache.doris.nereids.types.coercion.NumericType;
import org.apache.doris.nereids.types.coercion.PrimitiveType;
@ -433,6 +434,10 @@ public abstract class DataType implements AbstractDataType {
return this instanceof BooleanType;
}
public boolean isIntegerLikeType() {
return this instanceof IntegralType;
}
public boolean isTinyIntType() {
return this instanceof TinyIntType;
}