[fix](function) support return JsonType for If function (#35199)

add a FunctionSignature for If to support return Type is JsonType.
This commit is contained in:
Xujian Duan
2024-05-23 14:07:50 +08:00
committed by yiguolei
parent 9427942245
commit dd567fa774
3 changed files with 107 additions and 1 deletions

View File

@ -36,6 +36,7 @@ import org.apache.doris.nereids.types.DoubleType;
import org.apache.doris.nereids.types.FloatType;
import org.apache.doris.nereids.types.HllType;
import org.apache.doris.nereids.types.IntegerType;
import org.apache.doris.nereids.types.JsonType;
import org.apache.doris.nereids.types.LargeIntType;
import org.apache.doris.nereids.types.MapType;
import org.apache.doris.nereids.types.NullType;
@ -101,7 +102,9 @@ public class If extends ScalarFunction
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT)
.args(BooleanType.INSTANCE, VarcharType.SYSTEM_DEFAULT, VarcharType.SYSTEM_DEFAULT),
FunctionSignature.ret(StringType.INSTANCE)
.args(BooleanType.INSTANCE, StringType.INSTANCE, StringType.INSTANCE)
.args(BooleanType.INSTANCE, StringType.INSTANCE, StringType.INSTANCE),
FunctionSignature.ret(JsonType.INSTANCE)
.args(BooleanType.INSTANCE, JsonType.INSTANCE, JsonType.INSTANCE)
);
/**