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 20:33:25 UTC

[jira] [Commented] (CALCITE-1113) Parameter precision and scale are not returned from Avatica REST API

    [ https://issues.apache.org/jira/browse/CALCITE-1113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15224755#comment-15224755 ] 

Josh Elser commented on CALCITE-1113:
-------------------------------------

Looks like this was fixed (at some point). I'll add an explicit unit test and move on

{noformat}
{
  "ordinal":1,
  "autoIncrement":false,
  "caseSensitive":false,
  "searchable":true,
  "currency":false,
  "nullable":1,
  "signed":true,
  "displaySize":16,
  "label":"COLUMN1",
  "columnName":"COLUMN1",
  "schemaName":"SCOTT",
  "precision":15,
  "scale":0,
  "tableName":"DECIMALPARAMETERS",
  "catalogName":"PUBLIC",
  "type":{"type":"scalar","id":3,"name":"DECIMAL","rep":"OBJECT"},
  "readOnly":false,
  "writable":false,
  "definitelyWritable":false,
  "columnClassName":"java.math.BigDecimal"
},
{noformat}

For a table with {{column1 DECIMAL(15,0)}}.

> Parameter precision and scale are not returned from Avatica REST API
> --------------------------------------------------------------------
>
>                 Key: CALCITE-1113
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1113
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: 1.3.0-incubating
>            Reporter: Kevin Liew
>            Assignee: Josh Elser
>              Labels: phoenix
>             Fix For: next
>
>
> Create a table
> {noformat}
> CREATE TABLE IF DECIMAL_TABLE(
> keycolumn VARCHAR(255) PRIMARY KEY,
> column1 DECIMAL(38,0));
> {noformat}
> Prepare a parameterized statement
> {noformat}
> request:{"request":"prepare","connectionId":"3c39adc2-d13d-f87a-a63f-4ac6fbaf7CE8","sql":"select * from decimal_table where column1 > ? ","maxRowCount":"-1"}
> {noformat}
> {noformat}
> {"response":"prepare","statement":{"connectionId":"3c39adc2-d13d-f87a-a63f-4ac6fbaf7CE8","id":1891923767,"signature":{"columns":[{"ordinal":0,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":0,"signed":false,"displaySize":255,"label":"KEYCOLUMN","columnName":"KEYCOLUMN","schemaName":"","precision":255,"scale":0,"tableName":"DECIMAL_TABLE","catalogName":"","type":{"type":"scalar","id":12,"name":"VARCHAR","rep":"STRING"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.lang.String"},{"ordinal":1,"autoIncrement":false,"caseSensitive":false,"searchable":true,"currency":false,"nullable":1,"signed":true,"displaySize":38,"label":"COLUMN1","columnName":"COLUMN1","schemaName":"","precision":38,"scale":0,"tableName":"DECIMAL_TABLE","catalogName":"","type":{"type":"scalar","id":3,"name":"DECIMAL","rep":"OBJECT"},"readOnly":true,"writable":false,"definitelyWritable":false,"columnClassName":"java.math.BigDecimal"}],"sql":"select * from decimal_table where column1 > ? ","parameters":[{"signed":false,"precision":0,"scale":0,"parameterType":3,"typeName":"DECIMAL","className":"java.math.BigDecimal","name":"?1"}],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null}}}}
> {noformat}
> The precision and scale are always returned as '0'.
> {noformat}
> "parameters":[{"signed":false, "precision":0, "scale":0 ,"parameterType":3,"typeName":"DECIMAL","className":"java.math.BigDecimal","name":"?1"}],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null}}}}{noformat}



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