Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2407

Inconsistent behaviour on attempt to insert values larger than the max float

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 4.5.2
    • None
    • None
    • Phoenix 4.5.2 on HBase 1.1.2, Hadoop 2.7.0 running on Hortonworks HDP 2.3

    Description

      Case Statement Yields
      In range
      request: {
        "request": "prepareAndExecute",
        "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
        "sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1) VALUES('ConversionTestKey',3.402823466e+37)",
        "maxRowCount": -1
      }
      
      {
        "response": "Service$ExecuteResponse",
        "results": [
          {
            "response": "resultSet",
            "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
            "statementId": 259804592,
            "ownStatement": false,
            "signature": null,
            "firstFrame": null,
            "updateCount": 1
          }
        ]
      }
      
      Out of range
      request: {
        "request": "prepareAndExecute",
        "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
        "sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1) VALUES('ConversionTestKey',3.402823466e+39)",
        "maxRowCount": -1
      }
      
      HTTP/1.1 500 org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type mismatch. FLOAT and DOUBLE for 3.402823466E39
      Date: Thu, 12 Nov 2015 22:04:44 GMT
      Cache-Control: must-revalidate,no-cache,no-store
      Content-Type: text/html; charset=ISO-8859-1
      Content-Length: 387
      Connection: close
      Server: Jetty(9.2.z-SNAPSHOT)
      
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
      <title>Error 500 </title>
      </head>
      <body>
      <h2>HTTP ERROR: 500</h2>
      <p>Problem accessing /. Reason:
      <pre>    org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type mismatch. FLOAT and DOUBLE for 3.402823466E39</pre></p>
      <hr /><i><small>Powered by Jetty://</small></i>
      </body>
      </html>
      
      
      Out of range 2
      request: {"request":"prepareAndExecute","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","sql":"UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1) VALUES('ConversionTestKey',2.2250738585072014e-308)","maxRowCount":-1}
      
      {"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","statementId":1020495346,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
      
      

      The three cases differ only in the value being upserted for Column1. In the last case, ('ConversionTestKey', 0) is inserted whereas an error should be reported

      Attachments

        Activity

          People

            Unassigned Unassigned
            kliew Kevin Liew
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: