FrankChen021 commented on PR #20010:
URL: https://github.com/apache/druid/pull/20010#issuecomment-5300218970

   Regarding the `m4` assertion change:
   
   - `m4` originates from `rng.nextLong()` and is represented as a `Long` in 
`BenchmarkEvent`.
   - The exact decimal values are different:
     - `-3.8218837693501747E18` = `-3,821,883,769,350,174,700`
     - `-3821883769350174965` = `-3,821,883,769,350,174,965`
     - The absolute difference is 265.
   - With the old json-flattener path, this large integer was exposed as a 
`Double`; `Double.toString()` produced the scientific-notation text and could 
not preserve every integer unit at this magnitude.
   - Around 3.8e18, an IEEE-754 double has a spacing of 512. If both values are 
converted to `double`, they round to the same representable value: 
`-3821883769350174720`. This explains why the old output appeared numerically 
equivalent while not being the exact integer.
   - With json-flattener 0.7.1, the value remains an exact `Long`, so 
`Long.toString()` correctly exposes `-3821883769350174965`.
   
   Thus, the test update preserves the exact generated `long`; it does not 
change Druid runtime data or the source value. References: [`m4` is a 
Long](https://github.com/apache/druid/blob/edd54c78d5a9a8b5cd76acf38ff0cb2898d5864f/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtil.java#L458),
 [updated 
assertion](https://github.com/apache/druid/blob/edd54c78d5a9a8b5cd76acf38ff0cb2898d5864f/benchmarks/src/test/java/org/apache/druid/benchmark/FlattenJSONBenchmarkUtilTest.java#L93).


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to