scruz-denodo commented on PR #1407:
URL: https://github.com/apache/arrow-java/pull/1407#issuecomment-6464602613
Hi,
one last try to convince you that PostgreSQL and Oracle behavior are better
than SQLServer and Duckdb.
In a sense, the float type is a subset of the double type.
You have a value such `0.1` in a `float`. So it is expected, in my opinion,
that you can get that exact number on a `double` variable, because the `double`
type is able to represent the same number.
> Given that the drivers generally don't agree, then I don't think that
shows the behavior for Double is actually a problem. I can be convinced that
BigDecimal should be changed.
About this, I understand that you agree to the change but only affecting to
`getBigDecimal` method.
I would like to argue that at least `getObject` should be also modified.
The flight-sql driver is the unique from the tested drivers at previous comment
which is returning the number with extra decimals in that case.
The reason is that method `org.apache.calcite.avatica.AvaticaSite#get` is
relying on the `accessor.getDouble()` method for `FLOAT` and `DOUBLE` sql
types. So the returned value in this case is `0.10000000149011612`
``` java
public static Object get(Cursor.Accessor accessor, int targetSqlType,
boolean signed, Calendar localCalendar) throws SQLException {
....
case 6:
case 8:
double aDouble = accessor.getDouble();
if (aDouble == (double)0.0F && accessor.wasNull()) {
return null;
}
return aDouble;
```
That said, fixing the `getObject` method means to fix the `getDouble`, due
the `Avatica` implementation. So, in the end, the five methods would be
modified (same initial PR objective)
--
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]