github-actions[bot] commented on code in PR #62524:
URL: https://github.com/apache/doris/pull/62524#discussion_r3127952896
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Uniform.java:
##########
@@ -60,10 +60,10 @@ private Uniform(ScalarFunctionParams functionParams) {
@Override
public void checkLegalityBeforeTypeCoercion() {
- if (!child(0).isLiteral()) {
+ if (!getArgument(0).isLiteral()) {
Review Comment:
This change fixes variable backed literals that should be accepted for `min`
and `max`, but it also makes the inverse case reachable for `gen`. During
binding, `checkLegalityBeforeTypeCoercion()` now unwraps `@min` and `@max` via
`getArgument()`, then immediately calls `checkLegalityAfterRewrite()`, which
still inspects raw `child(2)`. That means `SET @seed = 1; SELECT uniform(@lo,
@hi, @seed)` now passes bind time validation even though the third parameter is
logically literal. After the later `VariableToLiteral` pass the expression
becomes `uniform(lit, lit, lit)`, and with `enable_fold_constant_by_be=true`
the normalization phase can fold the whole call before
`CheckLegalityAfterRewrite` runs, so the query succeeds instead of raising `The
third parameter (gen) of uniform function must not be literal`. Please validate
the third argument against the resolved argument too, or stop calling
`checkLegalityAfterRewrite()` from the pre coercion path.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/AGENTS.md:
##########
@@ -0,0 +1,5 @@
+# Nereids expressions — Review Guide
Review Comment:
This new `AGENTS.md` file is unrelated to the user variable fix, and the
repo guidance explicitly says `AGENTS.md` files should not be committed as part
of a normal bugfix change. Please drop it from this PR so the change stays
focused on the actual FE and test fixes.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]