diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java index 871062b04b296c..92063e6b9b30c3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java @@ -89,7 +89,6 @@ private static long parseIPv4toLong(String ipv4) { private static String parseLongToIPv4(long ipv4) { StringBuilder sb = new StringBuilder(); - sb.append("\""); for (int i = 3; i >= 0; i--) { short octet = (short) ((ipv4 >> (i * 8)) & 0xFF); sb.append(octet); @@ -97,7 +96,6 @@ private static String parseLongToIPv4(long ipv4) { sb.append("."); } } - sb.append("\""); return sb.toString(); } @@ -117,7 +115,7 @@ public Expr clone() { @Override protected String toSqlImpl() { - return getStringValue(); + return "\"" + getStringValue() + "\""; } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java index d8257d6175047f..bb986e0ffe7a2c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java @@ -75,7 +75,7 @@ private void checkValueValid(String ipv6) throws AnalysisException { @Override protected String toSqlImpl() { - return getStringValue(); + return "\"" + getStringValue() + "\""; } @Override @@ -101,7 +101,7 @@ public int compareLiteral(LiteralExpr expr) { @Override public String getStringValue() { - return "\"" + this.value + "\""; + return this.value; } @Override