imay commented on a change in pull request #1939: Added: Add tdigest compression param for pencentile_approx function URL: https://github.com/apache/incubator-doris/pull/1939#discussion_r333329835
########## File path: fe/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java ########## @@ -421,13 +421,23 @@ private void analyzeBuiltinAggFunction(Analyzer analyzer) throws AnalysisExcepti } if (fnName.getFunction().equalsIgnoreCase("percentile_approx")) { - if (children.size() != 2) { - throw new AnalysisException("percentile_approx(expr, DOUBLE) requires two parameters"); + if (children.size() != 2 && children.size() != 3) { + throw new AnalysisException("percentile_approx(expr, DOUBLE [, B]) requires two or three parameters"); } if (!getChild(1).isConstant()) { throw new AnalysisException("percentile_approx requires second parameter must be a constant : " + this.toSql()); } + if (children.size() == 3) { + if (!getChild(2).isConstant()) { + throw new AnalysisException("percentile_approx requires the third parameter must be a constant : " + + this.toSql()); + } + double param_3 = Expr.getConstFromExpr(getChild(2)); Review comment: 1. Frontend only support portion of all functions, some function can't be compute in Frontend. So better not compute this value, just do this in backend. When input value is not valid, just use default value. 2. param_3 should be renamed to param3 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org