imay 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_r282508965
##########
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:
use `LiteralExpr.uncheckCast`
----------------------------------------------------------------
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]