Skip to content

Commit

Permalink
Pipe: Fix the problem of missing precision when converting String typ…
Browse files Browse the repository at this point in the history
…e to Int32 and int64 types (#13643)
  • Loading branch information
luoluoyuyu authored Sep 26, 2024
1 parent 8797151 commit 8753985
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,11 @@ public static boolean convertTextToBoolean(final Binary value) {
}

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) {
Expand Down Expand Up @@ -653,11 +653,11 @@ public static boolean convertBlobToBoolean(final Binary value) {
}

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) {
Expand Down Expand Up @@ -691,11 +691,11 @@ public static boolean convertStringToBoolean(final Binary value) {
}

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) {
Expand Down

0 comments on commit 8753985

Please sign in to comment.