Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1113

Parameter precision and scale are not returned from Avatica REST API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0-incubating
    • avatica-1.8.0
    • avatica

    Description

      Create a table

      CREATE TABLE IF DECIMAL_TABLE(
      keycolumn VARCHAR(255) PRIMARY KEY,
      column1 DECIMAL(38,0));
      

      Prepare a parameterized statement

      request:{"request":"prepare","connectionId":"3c39adc2-d13d-f87a-a63f-4ac6fbaf7CE8","sql":"select * from decimal_table where column1 > ? ","maxRowCount":"-1"}
      
      {"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}}}}
      

      The precision and scale are always returned as '0'.

      "parameters":[{"signed":false, "precision":0, "scale":0 ,"parameterType":3,"typeName":"DECIMAL","className":"java.math.BigDecimal","name":"?1"}],"cursorFactory":{"style":"LIST","clazz":null,"fieldNames":null}}}}

      Attachments

        Issue Links

          Activity

            People

              elserj Josh Elser
              kliew Kevin Liew
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: