[
https://issues.apache.org/jira/browse/CALCITE-795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14624041#comment-14624041
]
Julian Hyde commented on CALCITE-795:
-------------------------------------
Agreed, stay as close as possible to the SQL type system. I get confused about
NUMBER vs NUMERIC, so you may be right.
> Loss of precision when sending a decimal number via the remote JSON service
> ---------------------------------------------------------------------------
>
> Key: CALCITE-795
> URL: https://issues.apache.org/jira/browse/CALCITE-795
> Project: Calcite
> Issue Type: Bug
> Reporter: Lukas Lalinsky
> Assignee: Julian Hyde
>
> When sending for example {code}{"type":"NUMBER","value":"333.333"}{code} to
> the "fetch" request of the remote JSON service, the exact value will not be
> kept and after one UPSERT/SELECT roundtrip in Phoenix I will get 333.332 back.
> Interestingly enough, this worked in Calcite 1.2 before the TypedValue class
> was introduced, but I think that working just by accident.
> The attached patch changes changes the Jackson object mapper to decode any
> JSON float to BigDecimal, unless the code explicitly asks for Float/Double. I
> think that shouldn't break anything and it solves this problem.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)