lewy-startree opened a new issue, #10743:
URL: https://github.com/apache/pinot/issues/10743

   
   We are seeing some different behaviors between 0.9.0 and latest Pinot:
   
   Some of our queries are selecting on bytesToBigDecimal(amount_decimal_hex) 
where amount_decimal_hex is BYTES column, values are hex strings like 
`001200e1905c5fd123ecb1`, and 
   
   I believe the related conversion logic on Pinot is 
[here](https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DataTypeConversionFunctions.java#L89).
   
   We're using Pinot java client to make the query, and reading the results 
with ResultSet.getString , in the particular example, our query to 
          0.9.0 Pinot got result: 16.253592621780561073, while query to 
         latest Pinot got result: 16.253592621780562, 
   notice the difference at the last few digits. 
   
   But re-running the same SQL from control UI, both clusters return 
16.253592621780561073 , the same results as 0.9.0 returned from Pinot client. 
   
   I did further experiment in local IDE with Pinot repo,
   ```
   BigDecimal amount = deserialize(bytes);
   System.out.println(hexString + " decoded to " + amount + ", to double:" + 
amount.doubleValue());
   ```
   outputs
   ```
   001200e1905c5fd123ecb1 decoded to 16.253592621780561073, to 
double:16.253592621780562
   ```
   
   It seems somehow the latest Pinot converts BigDecimal to double when 
serializing results into JSON? 
   Judging from [getString on 
ResultTableResultSet](https://github.com/apache/pinot/blob/master/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ResultTableResultSet.java#L62)
 where it gets the value from Jackson JsonNode. 
   Is there a way we can address this discrepancy?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to