You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xb...@apache.org on 2023/07/07 16:57:22 UTC

[pinot] branch master updated: format double 0 properly to compare with h2 results (#11049)

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

xbli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b21eb94c0 format double 0 properly to compare with h2 results (#11049)
9b21eb94c0 is described below

commit 9b21eb94c06f880502b34b816050983809989a9f
Author: Xiaobing <61...@users.noreply.github.com>
AuthorDate: Fri Jul 7 09:57:16 2023 -0700

    format double 0 properly to compare with h2 results (#11049)
---
 .../pinot/integration/tests/ClusterIntegrationTestUtils.java       | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java b/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java
index 204303e05e..2e8bf62640 100644
--- a/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java
+++ b/pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/ClusterIntegrationTestUtils.java
@@ -973,11 +973,10 @@ public class ClusterIntegrationTestUtils {
   private static String removeTrailingZeroForNumber(String value, String type) {
     String upperCaseType = StringUtils.upperCase(type);
     // remove trailing zero after decimal point to compare decimal numbers with h2 data
-    if (upperCaseType.equals("FLOAT") || upperCaseType.equals("DECFLOAT")
-        || upperCaseType.equals("DOUBLE") || upperCaseType.equals("DOUBLE PRECISION")) {
+    if (upperCaseType.equals("FLOAT") || upperCaseType.equals("DECFLOAT") || upperCaseType.equals("DOUBLE")
+        || upperCaseType.equals("DOUBLE PRECISION")) {
       try {
-        String result = (new BigDecimal(value)).stripTrailingZeros().toPlainString();
-        return result + ".0";
+        return (new BigDecimal(value)).stripTrailingZeros().toPlainString();
       } catch (NumberFormatException ignored) {
         // ignoring the exception
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org