This is an automated email from the ASF dual-hosted git repository.
HTHou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 92bc6263af6 Replace standalone Gson with Ratis shaded Gson (#19391)
92bc6263af6 is described below
commit 92bc6263af6104f92bb6ffd213f7814345d8e75d
Author: Haonan <[email protected]>
AuthorDate: Tue Nov 24 23:50:21 2026 +0800
Replace standalone Gson with Ratis shaded Gson (#19391)
---
LICENSE-binary | 1 -
dependencies.json | 1 -
example/rest-java-example/pom.xml | 4 ----
.../src/main/java/org/apache/iotdb/HttpExample.java | 12 +++++-------
.../src/main/java/org/apache/iotdb/HttpsExample.java | 12 +++++-------
.../main/java/org/apache/iotdb/TableHttpExample.java | 17 +++++++++--------
.../main/java/org/apache/iotdb/TableHttpsExample.java | 17 +++++++++--------
external-service-impl/mqtt/pom.xml | 5 -----
.../org/apache/iotdb/mqtt/JSONPayloadFormatter.java | 14 +++++++-------
.../org/apache/iotdb/cli/it/ExplainJsonCliOutputIT.java | 2 +-
.../org/apache/iotdb/db/it/GrafanaApiServiceIT.java | 4 ++--
.../apache/iotdb/db/it/IoTDBIPv6ExternalServiceIT.java | 4 ++--
.../java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java | 6 +++---
.../relational/it/query/recent/IoTDBComplexQueryIT.java | 6 +++---
.../it/query/recent/IoTExplainJsonFormatIT.java | 6 +++---
.../it/rest/it/IoTDBRestServiceCaseWhenThenIT.java | 6 +++---
.../it/rest/it/IoTDBRestServiceFlushQueryIT.java | 6 +++---
.../iotdb/relational/it/rest/it/IoTDBRestServiceIT.java | 6 +++---
.../it/rest/it/IoTDBRestServiceInsertValuesIT.java | 6 +++---
.../apache/iotdb/relational/it/rest/it/RestUtils.java | 4 ++--
iotdb-core/calc-commons/pom.xml | 4 ----
.../AbstractApproxMostFrequentAccumulator.java | 2 +-
.../aggregation/BlobApproxMostFrequentAccumulator.java | 2 +-
.../AbstractGroupedApproxMostFrequentAccumulator.java | 2 +-
.../BlobGroupedApproxMostFrequentAccumulator.java | 2 +-
iotdb-core/datanode/pom.xml | 4 ----
.../memory/TableModelStatementMemorySourceVisitor.java | 10 +++++-----
.../plan/planner/plan/node/PlanGraphJsonPrinter.java | 8 ++++----
.../FragmentInstanceStatisticsJsonDrawer.java | 8 ++++----
.../execution/operator/ExplainAnalyzeOperatorTest.java | 4 ++--
.../TableModelStatementMemorySourceVisitorTest.java | 6 +++---
.../plan/planner/node/PlanGraphJsonPrinterTest.java | 6 +++---
.../FragmentInstanceStatisticsJsonDrawerTest.java | 6 +++---
pom.xml | 11 +----------
34 files changed, 92 insertions(+), 122 deletions(-)
diff --git a/LICENSE-binary b/LICENSE-binary
index eceffad8ef5..46720fce663 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -229,7 +229,6 @@
com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.18.12
com.github.ben-manes.caffeine:caffeine:2.9.3
com.github.moquette-io.moquette:moquette-broker:0.18.0
com.google.code.findbugs:jsr305:3.0.2
-com.google.code.gson:gson:2.13.1
com.google.errorprone:error_prone_annotations:2.18.0
com.zaxxer:HikariCP:2.4.7
commons-cli:commons-cli:1.5.0
diff --git a/dependencies.json b/dependencies.json
index 0eaee55392e..48ec188c471 100644
--- a/dependencies.json
+++ b/dependencies.json
@@ -18,7 +18,6 @@
"com.github.moquette-io.moquette:moquette-broker",
"com.github.wendykierp:JTransforms",
"com.google.code.findbugs:jsr305",
- "com.google.code.gson:gson",
"com.google.errorprone:error_prone_annotations",
"com.h2database:h2-mvstore",
"com.sun.activation:jakarta.activation",
diff --git a/example/rest-java-example/pom.xml
b/example/rest-java-example/pom.xml
index 53f4c324126..1b7824c1c3b 100644
--- a/example/rest-java-example/pom.xml
+++ b/example/rest-java-example/pom.xml
@@ -33,10 +33,6 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
index 98f72892b68..56dccbf986f 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpExample.java
@@ -20,7 +20,6 @@
package org.apache.iotdb;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -40,6 +39,7 @@ import java.util.Map;
public class HttpExample {
private static final Logger LOGGER =
LoggerFactory.getLogger(HttpExample.class);
+ private static final ObjectMapper MAPPER = new ObjectMapper();
private static final String UTF8 = "utf-8";
@@ -64,7 +64,7 @@ public class HttpExample {
response = httpClient.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
LOGGER.info(result);
} catch (IOException e) {
LOGGER.error("The ping rest api failed", e);
@@ -100,7 +100,7 @@ public class HttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
LOGGER.info(result);
} catch (IOException e) {
LOGGER.error("The insertTablet rest api failed", e);
@@ -125,8 +125,7 @@ public class HttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- ObjectMapper mapper = new ObjectMapper();
- LOGGER.info("message = {}", mapper.readValue(message, Map.class));
+ LOGGER.info("message = {}", MAPPER.readValue(message, Map.class));
} catch (IOException e) {
LOGGER.error("The query rest api failed", e);
} finally {
@@ -151,8 +150,7 @@ public class HttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- ObjectMapper mapper = new ObjectMapper();
- LOGGER.info("message with time zone = {}", mapper.readValue(message,
Map.class));
+ LOGGER.info("message with time zone = {}", MAPPER.readValue(message,
Map.class));
} catch (IOException e) {
LOGGER.error("The query with time zone rest api failed", e);
} finally {
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
index 2e5c167133b..b72ccd25c4a 100644
--- a/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
+++ b/example/rest-java-example/src/main/java/org/apache/iotdb/HttpsExample.java
@@ -20,7 +20,6 @@
package org.apache.iotdb;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -39,6 +38,7 @@ import java.util.Map;
public class HttpsExample {
private static final Logger LOGGER =
LoggerFactory.getLogger(HttpsExample.class);
+ private static final ObjectMapper MAPPER = new ObjectMapper();
private static final String UTF8 = "utf-8";
@@ -63,7 +63,7 @@ public class HttpsExample {
response = httpClient.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
LOGGER.info(result);
} catch (IOException e) {
@@ -100,7 +100,7 @@ public class HttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
LOGGER.info(result);
} catch (IOException e) {
LOGGER.error("Https insertTablet rest api failed", e);
@@ -125,8 +125,7 @@ public class HttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- ObjectMapper mapper = new ObjectMapper();
- LOGGER.info("message = {}", mapper.readValue(message, Map.class));
+ LOGGER.info("message = {}", MAPPER.readValue(message, Map.class));
} catch (IOException e) {
LOGGER.error("Https query rest api failed", e);
} finally {
@@ -151,8 +150,7 @@ public class HttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- ObjectMapper mapper = new ObjectMapper();
- LOGGER.info("message with time zone = {}", mapper.readValue(message,
Map.class));
+ LOGGER.info("message with time zone = {}", MAPPER.readValue(message,
Map.class));
} catch (IOException e) {
LOGGER.error("Https query with time zone rest api failed", e);
} finally {
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
index c51ef67e6ad..5d49cf2b79f 100644
---
a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
+++
b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpExample.java
@@ -19,7 +19,7 @@
package org.apache.iotdb;
-import com.google.gson.JsonParser;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -37,6 +37,7 @@ import java.util.Base64;
public class TableHttpExample {
private static final Logger LOGGER =
LoggerFactory.getLogger(TableHttpExample.class);
+ private static final ObjectMapper MAPPER = new ObjectMapper();
private static final String UTF8 = "utf-8";
@@ -64,7 +65,7 @@ public class TableHttpExample {
response = httpClient.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
@@ -102,7 +103,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
@@ -130,7 +131,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The non query rest api failed");
@@ -156,7 +157,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The non query rest api failed");
@@ -183,7 +184,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("create table failed");
@@ -209,7 +210,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The query rest api failed");
@@ -237,7 +238,7 @@ public class TableHttpExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- LOGGER.info("message with time zone = {}",
JsonParser.parseString(message).getAsJsonObject());
+ LOGGER.info("message with time zone = {}", MAPPER.readTree(message));
} catch (IOException e) {
LOGGER.error("The query with time zone rest api failed", e);
} finally {
diff --git
a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
index 181db2ae999..098e26c3b86 100644
---
a/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
+++
b/example/rest-java-example/src/main/java/org/apache/iotdb/TableHttpsExample.java
@@ -19,7 +19,7 @@
package org.apache.iotdb;
-import com.google.gson.JsonParser;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -37,6 +37,7 @@ import java.util.Base64;
public class TableHttpsExample {
private static final Logger LOGGER =
LoggerFactory.getLogger(TableHttpsExample.class);
+ private static final ObjectMapper MAPPER = new ObjectMapper();
private static final String UTF8 = "utf-8";
@@ -64,7 +65,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpGet);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
@@ -102,7 +103,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- String result =
JsonParser.parseString(message).getAsJsonObject().toString();
+ String result = MAPPER.readTree(message).toString();
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
@@ -130,7 +131,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The non query rest api failed");
@@ -156,7 +157,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The non query rest api failed");
@@ -183,7 +184,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("create table failed");
@@ -209,7 +210,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
-
System.out.println(JsonParser.parseString(message).getAsJsonObject().toString());
+ System.out.println(MAPPER.readTree(message).toString());
} catch (IOException e) {
e.printStackTrace();
System.out.println("The query rest api failed");
@@ -237,7 +238,7 @@ public class TableHttpsExample {
response = httpClient.execute(httpPost);
HttpEntity responseEntity = response.getEntity();
String message = EntityUtils.toString(responseEntity, UTF8);
- LOGGER.info("message with time zone = {}",
JsonParser.parseString(message).getAsJsonObject());
+ LOGGER.info("message with time zone = {}", MAPPER.readTree(message));
} catch (IOException e) {
LOGGER.error("The query with time zone rest api failed", e);
} finally {
diff --git a/external-service-impl/mqtt/pom.xml
b/external-service-impl/mqtt/pom.xml
index 7a6b6f98de0..6a950eac6cb 100644
--- a/external-service-impl/mqtt/pom.xml
+++ b/external-service-impl/mqtt/pom.xml
@@ -83,11 +83,6 @@
<scope>provided</scope>
<version>2.0.13-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
diff --git
a/external-service-impl/mqtt/src/main/java/org/apache/iotdb/mqtt/JSONPayloadFormatter.java
b/external-service-impl/mqtt/src/main/java/org/apache/iotdb/mqtt/JSONPayloadFormatter.java
index 4d249cd5f02..a7d1a036f25 100644
---
a/external-service-impl/mqtt/src/main/java/org/apache/iotdb/mqtt/JSONPayloadFormatter.java
+++
b/external-service-impl/mqtt/src/main/java/org/apache/iotdb/mqtt/JSONPayloadFormatter.java
@@ -20,15 +20,15 @@ package org.apache.iotdb.mqtt;
import org.apache.iotdb.mqtt.i18n.MqttMessages;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.reflect.TypeToken;
import io.netty.buffer.ByteBuf;
import org.apache.ratis.thirdparty.com.google.common.collect.Lists;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.GsonBuilder;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonElement;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParseException;
+import org.apache.ratis.thirdparty.com.google.gson.reflect.TypeToken;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.external.commons.lang3.NotImplementedException;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/cli/it/ExplainJsonCliOutputIT.java
b/integration-test/src/test/java/org/apache/iotdb/cli/it/ExplainJsonCliOutputIT.java
index 5ea757e9904..d7d54f5cd1b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/cli/it/ExplainJsonCliOutputIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/cli/it/ExplainJsonCliOutputIT.java
@@ -23,7 +23,7 @@ import org.apache.iotdb.it.env.EnvFactory;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.TableLocalStandaloneIT;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
index 92256c82353..8d821062b2b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/GrafanaApiServiceIT.java
@@ -27,8 +27,6 @@ import org.apache.iotdb.itbase.category.RemoteIT;
import org.apache.iotdb.itbase.env.BaseEnv;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -37,6 +35,8 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBIPv6ExternalServiceIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBIPv6ExternalServiceIT.java
index 3899a133aad..c6fb8c929f6 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBIPv6ExternalServiceIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBIPv6ExternalServiceIT.java
@@ -30,8 +30,6 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT;
import org.apache.iotdb.rpc.StatementExecutionException;
import org.apache.iotdb.rpc.UrlUtils;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
@@ -39,6 +37,8 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.apache.tsfile.read.common.Field;
import org.apache.tsfile.read.common.RowRecord;
import org.awaitility.Awaitility;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
index 3015e9278ae..b40ad802b8b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
@@ -30,9 +30,6 @@ import org.apache.iotdb.itbase.env.BaseEnv;
import org.apache.iotdb.rpc.TSStatusCode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -41,6 +38,9 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBComplexQueryIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBComplexQueryIT.java
index f491c868f56..005922ae45b 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBComplexQueryIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBComplexQueryIT.java
@@ -26,9 +26,9 @@ import org.apache.iotdb.itbase.category.TableClusterIT;
import org.apache.iotdb.itbase.category.TableLocalStandaloneIT;
import org.apache.iotdb.itbase.env.BaseEnv;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonElement;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTExplainJsonFormatIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTExplainJsonFormatIT.java
index 3e640c200e8..3fcba3bd8cf 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTExplainJsonFormatIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTExplainJsonFormatIT.java
@@ -27,9 +27,9 @@ import
org.apache.iotdb.itbase.category.TableLocalStandaloneIT;
import org.apache.iotdb.itbase.env.BaseEnv;
import org.apache.iotdb.itbase.runtime.ClusterTestConnection;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceCaseWhenThenIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceCaseWhenThenIT.java
index dfba014cde7..a28e3e2cf4d 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceCaseWhenThenIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceCaseWhenThenIT.java
@@ -25,15 +25,15 @@ import org.apache.iotdb.itbase.category.TableClusterIT;
import org.apache.iotdb.itbase.category.TableLocalStandaloneIT;
import org.apache.iotdb.itbase.env.BaseEnv;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceFlushQueryIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceFlushQueryIT.java
index 9ec47467ec6..6a0d746f1fe 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceFlushQueryIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceFlushQueryIT.java
@@ -24,15 +24,15 @@ import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.*;
import org.apache.iotdb.itbase.env.BaseEnv;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java
index 05567b886fc..45f789ee0f8 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java
@@ -25,15 +25,15 @@ import org.apache.iotdb.itbase.category.TableClusterIT;
import org.apache.iotdb.itbase.category.TableLocalStandaloneIT;
import org.apache.iotdb.itbase.env.BaseEnv;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceInsertValuesIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceInsertValuesIT.java
index 1e2a82ad1f3..1caff83317e 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceInsertValuesIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceInsertValuesIT.java
@@ -24,15 +24,15 @@ import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.*;
import org.apache.iotdb.itbase.env.BaseEnv;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/RestUtils.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/RestUtils.java
index cf70f9900f4..f2445314e8e 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/RestUtils.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/RestUtils.java
@@ -19,14 +19,14 @@
package org.apache.iotdb.relational.it.rest.it;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import java.io.IOException;
import java.nio.charset.Charset;
diff --git a/iotdb-core/calc-commons/pom.xml b/iotdb-core/calc-commons/pom.xml
index 7a171ad6c99..45eaf1b9385 100644
--- a/iotdb-core/calc-commons/pom.xml
+++ b/iotdb-core/calc-commons/pom.xml
@@ -87,10 +87,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-thirdparty-misc</artifactId>
diff --git
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/AbstractApproxMostFrequentAccumulator.java
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/AbstractApproxMostFrequentAccumulator.java
index b929b6c27a2..9acf03b455e 100644
---
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/AbstractApproxMostFrequentAccumulator.java
+++
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/AbstractApproxMostFrequentAccumulator.java
@@ -23,7 +23,7 @@ import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.ap
import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.approximate.SpaceSavingStateFactory;
import org.apache.iotdb.calc.i18n.CalcMessages;
-import com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
import org.apache.tsfile.block.column.ColumnBuilder;
import org.apache.tsfile.file.metadata.statistics.Statistics;
import org.apache.tsfile.utils.Binary;
diff --git
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/BlobApproxMostFrequentAccumulator.java
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/BlobApproxMostFrequentAccumulator.java
index c70e0855c83..3f58bf7a5b7 100644
---
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/BlobApproxMostFrequentAccumulator.java
+++
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/BlobApproxMostFrequentAccumulator.java
@@ -19,7 +19,7 @@
package org.apache.iotdb.calc.execution.operator.source.relational.aggregation;
-import com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
import org.apache.tsfile.block.column.ColumnBuilder;
import org.apache.tsfile.utils.Binary;
import org.apache.tsfile.utils.BytesUtils;
diff --git
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/AbstractGroupedApproxMostFrequentAccumulator.java
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/AbstractGroupedApproxMostFrequentAccumulator.java
index 925c74ce261..9b3f88f94ae 100644
---
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/AbstractGroupedApproxMostFrequentAccumulator.java
+++
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/AbstractGroupedApproxMostFrequentAccumulator.java
@@ -23,7 +23,7 @@ import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.ap
import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.approximate.SpaceSavingStateFactory;
import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.grouped.array.SpaceSavingBigArray;
-import com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
import org.apache.tsfile.block.column.ColumnBuilder;
import org.apache.tsfile.utils.Binary;
diff --git
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/BlobGroupedApproxMostFrequentAccumulator.java
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/BlobGroupedApproxMostFrequentAccumulator.java
index 36f7278224f..9f7dd07be85 100644
---
a/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/BlobGroupedApproxMostFrequentAccumulator.java
+++
b/iotdb-core/calc-commons/src/main/java/org/apache/iotdb/calc/execution/operator/source/relational/aggregation/grouped/BlobGroupedApproxMostFrequentAccumulator.java
@@ -21,7 +21,7 @@ package
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.g
import
org.apache.iotdb.calc.execution.operator.source.relational.aggregation.approximate.SpaceSaving;
-import com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
import org.apache.tsfile.block.column.ColumnBuilder;
import org.apache.tsfile.utils.Binary;
import org.apache.tsfile.utils.BytesUtils;
diff --git a/iotdb-core/datanode/pom.xml b/iotdb-core/datanode/pom.xml
index 815f972a28a..5321b646f6a 100644
--- a/iotdb-core/datanode/pom.xml
+++ b/iotdb-core/datanode/pom.xml
@@ -226,10 +226,6 @@
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </dependency>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitor.java
index 38fc437d1b7..d0da6f8fa3c 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitor.java
@@ -41,11 +41,11 @@ import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Explain;
import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ExplainOutputFormat;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDevice;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.GsonBuilder;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.read.common.block.TsBlock;
import org.apache.tsfile.utils.Pair;
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/PlanGraphJsonPrinter.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/PlanGraphJsonPrinter.java
index a5f6e061453..b6dc1858a94 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/PlanGraphJsonPrinter.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/PlanGraphJsonPrinter.java
@@ -38,10 +38,10 @@ import
org.apache.iotdb.db.queryengine.plan.relational.planner.node.ExchangeNode
import
org.apache.iotdb.db.queryengine.plan.relational.planner.node.ExplainAnalyzeNode;
import
org.apache.iotdb.db.queryengine.plan.relational.planner.node.TreeDeviceViewScanNode;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.GsonBuilder;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawer.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawer.java
index e5a18ce7507..5ca79595405 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawer.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawer.java
@@ -27,10 +27,10 @@ import
org.apache.iotdb.mpp.rpc.thrift.TFetchFragmentInstanceStatisticsResp;
import org.apache.iotdb.mpp.rpc.thrift.TOperatorStatistics;
import org.apache.iotdb.mpp.rpc.thrift.TQueryStatistics;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.Gson;
+import org.apache.ratis.thirdparty.com.google.gson.GsonBuilder;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
import java.util.List;
import java.util.Map;
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/ExplainAnalyzeOperatorTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/ExplainAnalyzeOperatorTest.java
index bb5b007ab44..33744eb6d55 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/ExplainAnalyzeOperatorTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/ExplainAnalyzeOperatorTest.java
@@ -27,8 +27,8 @@ import org.apache.iotdb.db.queryengine.common.QueryId;
import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ExplainOutputFormat;
import
org.apache.iotdb.db.queryengine.statistics.FragmentInstanceStatisticsJsonDrawer;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.apache.tsfile.common.conf.TSFileConfig;
import org.apache.tsfile.read.common.block.TsBlock;
import org.junit.Test;
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitorTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitorTest.java
index 134d94aca36..313e6110afd 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitorTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitorTest.java
@@ -23,9 +23,9 @@ import
org.apache.iotdb.commons.queryengine.plan.relational.analyzer.NodeRef;
import
org.apache.iotdb.commons.queryengine.plan.relational.sql.ast.QualifiedName;
import org.apache.iotdb.commons.queryengine.plan.relational.sql.ast.Table;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.apache.tsfile.utils.Pair;
import org.junit.Test;
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/node/PlanGraphJsonPrinterTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/node/PlanGraphJsonPrinterTest.java
index 0396d224b7a..b8fb3d7cdfb 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/node/PlanGraphJsonPrinterTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/node/PlanGraphJsonPrinterTest.java
@@ -57,12 +57,12 @@ import
org.apache.iotdb.db.queryengine.plan.relational.planner.node.TreeDeviceVi
import
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ExplainOutputFormat;
import org.apache.iotdb.db.queryengine.plan.statement.component.Ordering;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
import org.apache.ratis.thirdparty.com.google.common.collect.ImmutableList;
import
org.apache.ratis.thirdparty.com.google.common.collect.ImmutableListMultimap;
import org.apache.ratis.thirdparty.com.google.common.collect.ImmutableMap;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.file.metadata.StringArrayDeviceID;
import org.apache.tsfile.read.common.type.TypeFactory;
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawerTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawerTest.java
index 4acbf2ac255..758cb0ac322 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawerTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/statistics/FragmentInstanceStatisticsJsonDrawerTest.java
@@ -33,9 +33,9 @@ import
org.apache.iotdb.mpp.rpc.thrift.TFetchFragmentInstanceStatisticsResp;
import org.apache.iotdb.mpp.rpc.thrift.TOperatorStatistics;
import org.apache.iotdb.mpp.rpc.thrift.TQueryStatistics;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import org.apache.ratis.thirdparty.com.google.gson.JsonArray;
+import org.apache.ratis.thirdparty.com.google.gson.JsonObject;
+import org.apache.ratis.thirdparty.com.google.gson.JsonParser;
import org.junit.Test;
import java.time.ZoneId;
diff --git a/pom.xml b/pom.xml
index 310e77527ba..fe5b2457c12 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,6 @@
<forbiddenapis.version>3.10</forbiddenapis.version>
<fusesource-mqtt-client.version>1.16</fusesource-mqtt-client.version>
<google.java.format.version>1.28.0</google.java.format.version>
- <gson.version>2.13.1</gson.version>
<h2.version>2.2.224</h2.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
@@ -271,11 +270,6 @@
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api.version}</version>
</dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
@@ -612,10 +606,7 @@
<artifactId>asm</artifactId>
<version>9.3</version>
</dependency>
- <!-- Conflict:
- gson (pulls in 2.38.0),
- caffeine (pulls in 2.10.0)
- -->
+ <!-- Caffeine pulls in 2.10.0. -->
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>