scruz-denodo opened a new pull request, #1407:
URL: https://github.com/apache/arrow-java/pull/1407

   ## What's Changed
   
   `ArrowFlightJdbcFloat4VectorAccessor` no longer exposes float-widening 
artifacts when a `Float4Vector ` is read as a `double` or a `decimal`.
   - `getDouble()` (and therefore `getObject(Double.class)`) now returns 
`Double.parseDouble(Float.toString(value))` instead of `(double) value`. A 
`0.1f` cell now gives `0.1,` not` 0.10000000149011612`.
   - `getBigDecimal() `and `getBigDecimal(int scale)` now use `new 
BigDecimal(Float.toString(value))` instead of `BigDecimal.valueOf(value)`, 
which widened the float to a double first.
   - `NaN` and `±Infinity` are still returned by `getDouble()`. 
`getBigDecimal()` still throws `SQLException` for them, and `null `cells still 
return `0.0` / `null`.
   
   **Tests (ArrowFlightJdbcFloat4VectorAccessorTest)**:
   - `getDouble `and `getBigDecimal `expectations now use Float.toString.
   - A new test checks that `(float) getDouble() == getFloat()`.
   - A new test covers 0.1f, -0.1f, 0.2f, 0.3f, 1.1f, 123.456f, 3.4e-5f and 
-0.0f through `getDouble`, `getObject(Double.class)`, `getBigDecimal()` and 
`getBigDecimal(9)`.
   - A 0.1f test checks 0.1, 0.1 and 0.100000000.
   - A `NaN getDouble` test is added.
   
   Closes #1406.
   


-- 
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]

Reply via email to