diff --git a/fe/src/main/java/org/apache/doris/analysis/BoolLiteral.java b/fe/src/main/java/org/apache/doris/analysis/BoolLiteral.java index 53a8e5002740c3..6586efd177222d 100644 --- a/fe/src/main/java/org/apache/doris/analysis/BoolLiteral.java +++ b/fe/src/main/java/org/apache/doris/analysis/BoolLiteral.java @@ -79,12 +79,12 @@ public int compareLiteral(LiteralExpr expr) { @Override public String toSqlImpl() { - return getStringValue(); + return value ? "TRUE" : "FALSE"; } @Override public String getStringValue() { - return value ? "TRUE" : "FALSE"; + return value ? "1" : "0"; } @Override diff --git a/fe/src/main/java/org/apache/doris/analysis/DecimalLiteral.java b/fe/src/main/java/org/apache/doris/analysis/DecimalLiteral.java index 5895f3a4566a43..77373a9781dc15 100644 --- a/fe/src/main/java/org/apache/doris/analysis/DecimalLiteral.java +++ b/fe/src/main/java/org/apache/doris/analysis/DecimalLiteral.java @@ -169,6 +169,16 @@ public String getStringValue() { return value.toString(); } + @Override + public long getLongValue() { + return value.longValue(); + } + + @Override + public double getDoubleValue() { + return value.doubleValue(); + } + @Override protected void toThrift(TExprNode msg) { // TODO(hujie01) deal with loss information