chenhao7253886 commented on a change in pull request #1126: FE support
assigning constant conjunct and calculating expression
URL: https://github.com/apache/incubator-doris/pull/1126#discussion_r282810304
##########
File path: fe/src/main/java/org/apache/doris/analysis/CastExpr.java
##########
@@ -248,4 +248,33 @@ public boolean canHashPartition() {
return false;
}
+ @Override
+ public Expr getResultValue() throws AnalysisException {
+ final Expr value = children.get(0).getResultValue();
+ if (!(value instanceof LiteralExpr)) {
+ return this;
+ }
+
+ final Expr targetExpr = castTo((LiteralExpr)value);
+ return targetExpr;
+ }
+
+ private Expr castTo(LiteralExpr value) throws AnalysisException {
Review comment:
This can't use uncheckCast, it is used by impliclit cast and it will return
new CastExpr for no supporting type, so it will cause dead loop.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]