You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2016/04/04 17:14:25 UTC

[jira] [Resolved] (CALCITE-1103) Decimal data serialized as Double in Protocol Buffer API

     [ https://issues.apache.org/jira/browse/CALCITE-1103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Elser resolved CALCITE-1103.
---------------------------------
       Resolution: Fixed
    Fix Version/s: avatica-1.8.0

Fixed in https://git1-us-west.apache.org/repos/asf?p=calcite.git;a=commit;h=aa9db8a36046b1e812021fa1cf0973906cfffbad

Thanks for reporting, [~kliew]!

> Decimal data serialized as Double in Protocol Buffer API
> --------------------------------------------------------
>
>                 Key: CALCITE-1103
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1103
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: 1.6.0, 1.5.0, avatica-1.7.0, avatica-1.7.1
>         Environment: HDP 2.3.4 with Phoenix 4.4 and Calcite 1.5
>            Reporter: Kevin Liew
>            Assignee: Josh Elser
>            Priority: Minor
>              Labels: decimal, double, protobuf
>             Fix For: avatica-1.8.0
>
>
> Decimal data is serialized as TypedValue.double_value and loses precision.
> Decoded Wireshark capture
> {code:sql}select * from decimal_table{code}
> {noformat}
> [employee@centos7-ws test]$ protoc --decode_raw < test.pb
> 1: "org.apache.calcite.avatica.proto.Responses$ExecuteResponse"
> 2 {
>   1 {
>     1: "cf74c4e9-29bc-410a-b557-bf7a4965cbaf"
>     2: 479389
>     3: 1
>     4 {
>       1 {
>         4: 1
>         8: 255
>         9: "KEYCOLUMN"
>         10: "KEYCOLUMN"
>         12: 255
>         14: "DECIMAL_TABLE_38_6"
>         16: 1
>         19: "java.lang.String"
>         20 {
>           1: 12
>           2: "VARCHAR"
>           3: 21
>         }
>       }
>       1 {
>         1: 1
>         4: 1
>         6: 1
>         7: 1
>         8: 38
>         9: "COLUMN1"
>         10: "COLUMN1"
>         12: 38
>         13: 6
>         14: "DECIMAL_TABLE_38_6"
>         16: 1
>         19: "java.math.BigDecimal"
>         20 {
>           1: 3
>           2: "DECIMAL"
>           3: 23
>         }
>       }
>       2: "select * from decimal_table_38_6"
>       4 {
>         1: 4
>       }
>     }
>     5 {
>       2: 1
>       3 {
>         1 {
>           1 {
>             1: 21
>             3: "ConversionTestKey"
>           }
>         }
>         1 {
>           1 {
>             1: 22
>             6: 0x3ffe666666666666
>           }
>         }
>       }
>       3 {
>         1 {
>           1 {
>             1: 21
>             3: "FractionalNumeric6"
>           }
>         }
>         1 {
>           1 {
>             1: 22
>             6: 0x40ba0a524af0bf1a
>           }
>         }
>       }
>       3 {
>         1 {
>           1 {
>             1: 21
>             3: "FractionalNumeric8"
>           }
>         }
>         1 {
>           1 {
>             1: 22
>             6: 0xbff1f9acffa7eb6c
>           }
>         }
>       }
>       3 {
>         1 {
>           1 {
>             1: 21
>             3: "Null"
>           }
>         }
>         1 {
>           1 {
>             1: 24
>           }
>         }
>       }
>       3 {
>         1 {
>           1 {
>             1: 21
>             3: "OnePlusFraction"
>           }
>         }
>         1 {
>           1 {
>             1: 22
>             6: 0x3ff000010c6f7a0b
>           }
>         }
>       }
>     }
>     6: 18446744073709551615
>     7 {
>       1: "centos7-ws:8765"
>     }
>   }
>   3 {
>     1: "centos7-ws:8765"
>   }
> }
> {noformat}
> The column1 data is tagged with 6 which corresponds to double_value in the proto file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)