Xianqing He has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/25165


Change subject: IMPALA-15604: Fix SimplifyDistinctFromRule with 
nondeterministic expressions
......................................................................

IMPALA-15604: Fix SimplifyDistinctFromRule with nondeterministic expressions

SimplifyDistinctFromRule rewrote "x IS [NOT] DISTINCT FROM x" to a constant
whenever the operands were structurally equal. Expr.equals() ignores whether
an expression is nondeterministic, so expressions such as uuid(), rand(),
random(), and UDF calls could be folded incorrectly even though separate
invocations are not guaranteed to return the same value.

Skip the rewrite when the predicate contains a nondeterministic builtin
function or a UDF. Add ai_generate_text and ai_generate_text_default to
NON_DETERMINISTIC_FNS since they perform an external request per invocation.

Add regression tests for builtin nondeterministic functions, nested
expressions, UDFs, nullif, and deterministic functions.

Testing:
- ExprRewriteRulesTest
- TupleCacheTest#testIneligibility

Assisted-by: deepseek-v4.1-flash (opencode)
Change-Id: Ic55d4416e2952b0700601c26d3165cf1d50ab47f
---
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/main/java/org/apache/impala/rewrite/SimplifyDistinctFromRule.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriteRulesTest.java
3 files changed, 47 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/65/25165/1
--
To view, visit http://gerrit.cloudera.org:8080/25165
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic55d4416e2952b0700601c26d3165cf1d50ab47f
Gerrit-Change-Number: 25165
Gerrit-PatchSet: 1
Gerrit-Owner: Xianqing He <[email protected]>

Reply via email to