From 0c83421e3735e8099f619a4c05a7677cd9c095e0 Mon Sep 17 00:00:00 2001 From: amorynan Date: Thu, 12 Dec 2024 18:27:29 +0800 Subject: [PATCH] fixed --- .../src/main/java/org/apache/doris/analysis/IPv4Literal.java | 4 +--- .../src/main/java/org/apache/doris/analysis/IPv6Literal.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) 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