You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/25 12:46:26 UTC

[GitHub] [incubator-doris] xinghuayu007 commented on a change in pull request #4439: Validate the param of rand function in compile step

xinghuayu007 commented on a change in pull request #4439:
URL: https://github.com/apache/incubator-doris/pull/4439#discussion_r476419682



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
##########
@@ -1405,7 +1405,15 @@ protected Function getBuiltinFunction(
             throws AnalysisException {
         FunctionName fnName = new FunctionName(name);
         Function searchDesc = new Function(fnName, argTypes, Type.INVALID, false);
-        return Catalog.getCurrentCatalog().getFunction(searchDesc, mode);
+        Function f = Catalog.getCurrentCatalog().getFunction(searchDesc, mode);
+        if (f != null && fnName.getFunction().equalsIgnoreCase("rand")) {
+            if (this.children != null

Review comment:
       Rand function has two implements. One is Rand(const int), the other is Rand() without parm**.  this.children != null** filters Rand() without param.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org