[function](string) support char function (#18878)
* [function](string) support char function * fix
This commit is contained in:
@ -1444,6 +1444,19 @@ public class FunctionCallExpr extends Expr {
|
||||
.toSql());
|
||||
}
|
||||
}
|
||||
if (fnName.getFunction().equalsIgnoreCase("char")) {
|
||||
if (!getChild(0).isConstant()) {
|
||||
throw new AnalysisException(
|
||||
fnName.getFunction() + " charset name must be a constant: " + this
|
||||
.toSql());
|
||||
}
|
||||
LiteralExpr literal = (LiteralExpr) getChild(0);
|
||||
if (!literal.getStringValue().equalsIgnoreCase("utf8")) {
|
||||
throw new AnalysisException(
|
||||
fnName.getFunction() + " function currently only support charset name 'utf8': " + this
|
||||
.toSql());
|
||||
}
|
||||
}
|
||||
if (fn.getFunctionName().getFunction().equals("timediff")) {
|
||||
fn.getReturnType().getPrimitiveType().setTimeType();
|
||||
}
|
||||
@ -1500,6 +1513,10 @@ public class FunctionCallExpr extends Expr {
|
||||
ix = i % 2 == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
if (i == 0 && (fnName.getFunction().equalsIgnoreCase("char"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((fnName.getFunction().equalsIgnoreCase("money_format") || fnName.getFunction()
|
||||
.equalsIgnoreCase("histogram")
|
||||
|| fnName.getFunction().equalsIgnoreCase("hist"))
|
||||
|
||||
Reference in New Issue
Block a user