You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Reminiscent (via GitHub)" <gi...@apache.org> on 2023/06/05 09:40:15 UTC

[GitHub] [doris] Reminiscent commented on a diff in pull request #20334: [feature](optimizer): support user defined variable

Reminiscent commented on code in PR #20334:
URL: https://github.com/apache/doris/pull/20334#discussion_r1217808848


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java:
##########
@@ -989,7 +989,8 @@ public TExpr treeToThrift() {
             // Hack to ensure BE never sees TYPE_NULL. If an expr makes it this far without
             // being cast to a non-NULL type, the type doesn't matter and we can cast it
             // arbitrarily.
-            Preconditions.checkState(this instanceof NullLiteral || this instanceof SlotRef);
+            Preconditions.checkState(this instanceof NullLiteral || this instanceof SlotRef
+                    || this instanceof VariableExpr);

Review Comment:
   Because when we `set @a=null` and use the `@a` in the statement, for example, `select @a ....`. The `@a` will be built as `VariableExpr` not the `NullLiteral`



-- 
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: commits-unsubscribe@doris.apache.org

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