This is an automated email from the ASF dual-hosted git repository.

rong 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 8753985882d Pipe: Fix the problem of missing precision when converting 
String type to Int32 and int64 types (#13643)
8753985882d is described below

commit 8753985882dc8d4a355bd737aec57bd881ae1779
Author: Zhenyu Luo <[email protected]>
AuthorDate: Thu Sep 26 20:12:53 2024 +0800

    Pipe: Fix the problem of missing precision when converting String type to 
Int32 and int64 types (#13643)
---
 .../db/pipe/receiver/transform/converter/ValueConverter.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/transform/converter/ValueConverter.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/transform/converter/ValueConverter.java
index db38102ca9d..09e2f265ec5 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/transform/converter/ValueConverter.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/transform/converter/ValueConverter.java
@@ -527,11 +527,11 @@ public class ValueConverter {
   }
 
   public static int convertTextToInt32(final Binary value) {
-    return parseInteger(value.toString());
+    return (int) parseDouble(value.toString());
   }
 
   public static long convertTextToInt64(final Binary value) {
-    return parseLong(value.toString());
+    return (long) parseDouble(value.toString());
   }
 
   public static float convertTextToFloat(final Binary value) {
@@ -653,11 +653,11 @@ public class ValueConverter {
   }
 
   public static int convertBlobToInt32(final Binary value) {
-    return parseInteger(value.toString());
+    return (int) parseDouble(value.toString());
   }
 
   public static long convertBlobToInt64(final Binary value) {
-    return parseLong(value.toString());
+    return (long) parseDouble(value.toString());
   }
 
   public static float convertBlobToFloat(final Binary value) {
@@ -691,11 +691,11 @@ public class ValueConverter {
   }
 
   public static int convertStringToInt32(final Binary value) {
-    return parseInteger(value.toString());
+    return (int) parseDouble(value.toString());
   }
 
   public static long convertStringToInt64(final Binary value) {
-    return parseLong(value.toString());
+    return (long) parseDouble(value.toString());
   }
 
   public static float convertStringToFloat(final Binary value) {

Reply via email to