[Vectorized](function) support order by convert_to function (#14555)
This commit is contained in:
@ -5861,6 +5861,13 @@ non_pred_expr ::=
|
||||
{: RESULT = new CastExpr(targetType, e); :}
|
||||
| KW_KEY encryptkey_name:name
|
||||
{: RESULT = new EncryptKeyRef(name); :}
|
||||
| KW_CONVERT LPAREN expr:e KW_USING ident:character RPAREN
|
||||
{:
|
||||
ArrayList<Expr> exprs = new ArrayList<>();
|
||||
exprs.add(e);
|
||||
exprs.add(new StringLiteral(character));
|
||||
RESULT = new FunctionCallExpr("convert_to", new FunctionParams(exprs));
|
||||
:}
|
||||
;
|
||||
|
||||
expr_pipe_list ::=
|
||||
|
||||
@ -606,7 +606,6 @@ public class FunctionCallExpr extends Expr {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (fnName.getFunction().equalsIgnoreCase("group_concat")) {
|
||||
if (children.size() - orderByElements.size() > 2 || children.isEmpty()) {
|
||||
throw new AnalysisException(
|
||||
@ -1229,7 +1228,13 @@ public class FunctionCallExpr extends Expr {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fnName.getFunction().equalsIgnoreCase("convert_to")) {
|
||||
if (children.size() < 2 || !getChild(1).isConstant()) {
|
||||
throw new AnalysisException(
|
||||
fnName.getFunction() + " needs two params, and the second is must be a constant: " + this
|
||||
.toSql());
|
||||
}
|
||||
}
|
||||
if (fn.getFunctionName().getFunction().equals("timediff")) {
|
||||
fn.getReturnType().getPrimitiveType().setTimeType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user