You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "bziobrowski (via GitHub)" <gi...@apache.org> on 2024/11/05 10:00:55 UTC

Re: [PR] Fix long value parsing in jsonextractscalar [pinot]

bziobrowski commented on code in PR #14337:
URL: https://github.com/apache/pinot/pull/14337#discussion_r1829065409


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/JsonExtractScalarTransformFunction.java:
##########
@@ -184,8 +184,12 @@ public long[] transformToLongValuesSV(ValueBlock valueBlock) {
       if (result instanceof Number) {
         _longValuesSV[i] = ((Number) result).longValue();
       } else {
-        // Handle scientific notation
-        _longValuesSV[i] = (long) Double.parseDouble(result.toString());
+        try {

Review Comment:
   That's weird because if we parse as double but then cast to long then we lose fractional anyway and get to lose precision for value longer than 15 digits. The only difference parsing as double could make is for parsing numbers with fractional part or scientific notation.  



-- 
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-unsubscribe@pinot.apache.org

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


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