impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Behm (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4574: Do not treat UUID() like a constant expr.
Date Fri, 02 Dec 2016 19:32:17 GMT
Alex Behm has posted comments on this change.

Change subject: IMPALA-4574: Do not treat UUID() like a constant expr.
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/5324/1//COMMIT_MSG
Commit Message:

Line 23: 1. Pass a flag from FE to BE for ever Expr indicating its constness.
> I think there are two low-risk ways we could solve the problem.
I think my current patch and both of your suggestions are throw-away work. We are very likely
going to change it completely in the future, so at this point I'd prefer the solution which
is minimally invasive. I agree your proposals are simpler than my listed alternatives here,
but they are still not as simple as this patch.


http://gerrit.cloudera.org:8080/#/c/5324/1/be/src/exprs/scalar-fn-call.cc
File be/src/exprs/scalar-fn-call.cc:

Line 261:   if (fn_.name.function_name == "rand" || fn_.name.function_name == "random"
> Are the names always converted to lower case?
Yes. See FunctionName#analyzeFnNamePath().


http://gerrit.cloudera.org:8080/#/c/5324/1/fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
File fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java:

Line 245:     // Non-deterministic functions are never constant.
> If we're sticking with this solution, should add comments that cross-refere
Done


Line 246:     if (fnName.equalsIgnoreCase("rand") || fnName.equalsIgnoreCase("random")
> I think we still need to consider what to do about non-deterministic UDFs. 
Agree that we need to deal with such UDFs in a more principled way.

I don't think we need to add extra flags or logic. You can disable constant folding with enable_expr_rewrites=false,
so there is a workaround for this hopefully exotic case of non-deterministic UDFs that are
invoked with no or only constant arguments.


http://gerrit.cloudera.org:8080/#/c/5324/1/testdata/workloads/functional-query/queries/QueryTest/exprs.test
File testdata/workloads/functional-query/queries/QueryTest/exprs.test:

Line 2579: select count(*) from functional.alltypestiny group by uuid()
> Can you add a test where UUID() is an argument to an operator or function? 
I modified this one like you suggested.


-- 
To view, visit http://gerrit.cloudera.org:8080/5324
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If2499f5f6ecdcb098623202c8e6dc2d02727194a
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message