[
https://issues.apache.org/jira/browse/PHOENIX-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Liew updated PHOENIX-2407:
--------------------------------
Description:
|Case|Statement|Yields|
|In range|{noformat}
request: {
"request": "prepareAndExecute",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',3.402823466e+37)",
"maxRowCount": -1
}
{noformat}|{noformat}
{
"response": "Service$ExecuteResponse",
"results": [
{
"response": "resultSet",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"statementId": 259804592,
"ownStatement": false,
"signature": null,
"firstFrame": null,
"updateCount": 1
}
]
}
{noformat}
|Out of range|{noformat}
request: {
"request": "prepareAndExecute",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',3.402823466e+39)",
"maxRowCount": -1
}
{noformat}|{noformat}
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>
{noformat}
|Out of range 2|{noformat}
request:
{"request":"prepareAndExecute","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","sql":"UPSERT
INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',2.2250738585072014e-308)","maxRowCount":-1}
{noformat}|{noformat}
{"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","statementId":1020495346,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
{noformat}|
The three cases differ only in the value being inserted for Column1. In the
last case, ('ConversionTestKey', 0) is inserted whereas an error should be
reported
was:
|Case|Statement|Yields|
|In range|{noformat}
request: {
"request": "prepareAndExecute",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',3.402823466e+37)",
"maxRowCount": -1
}
{noformat}|{noformat}
{
"response": "Service$ExecuteResponse",
"results": [
{
"response": "resultSet",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"statementId": 259804592,
"ownStatement": false,
"signature": null,
"firstFrame": null,
"updateCount": 1
}
]
}
{noformat}
|Out of range|{noformat}
request: {
"request": "prepareAndExecute",
"connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
"sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',3.402823466e+39)",
"maxRowCount": -1
}
{noformat}|{noformat}
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>
{noformat}
|Out of range 2|{noformat}
request:
{"request":"prepareAndExecute","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","sql":"UPSERT
INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
VALUES('ConversionTestKey',2.2250738585072014e-308)","maxRowCount":-1}
{noformat}|{noformat}
{"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","statementId":1020495346,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
{noformat}|
In the last case, ('ConversionTestKey', 0) is inserted whereas an error should
be reported
> Inconsistent behaviour on attempt to insert values larger than the max float
> ----------------------------------------------------------------------------
>
> Key: PHOENIX-2407
> URL: https://issues.apache.org/jira/browse/PHOENIX-2407
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.5.2
> Environment: Phoenix 4.5.2 on HBase 1.1.2, Hadoop 2.7.0 running on
> Hortonworks HDP 2.3
> Reporter: Kevin Liew
> Priority: Minor
> Labels: double, float, phoenix
>
> |Case|Statement|Yields|
> |In range|{noformat}
> request: {
> "request": "prepareAndExecute",
> "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
> "sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
> VALUES('ConversionTestKey',3.402823466e+37)",
> "maxRowCount": -1
> }
> {noformat}|{noformat}
> {
> "response": "Service$ExecuteResponse",
> "results": [
> {
> "response": "resultSet",
> "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
> "statementId": 259804592,
> "ownStatement": false,
> "signature": null,
> "firstFrame": null,
> "updateCount": 1
> }
> ]
> }
> {noformat}
> |Out of range|{noformat}
> request: {
> "request": "prepareAndExecute",
> "connectionId": "29770bfd-c923-712e-40b3-b097d4348A2F",
> "sql": "UPSERT INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
> VALUES('ConversionTestKey',3.402823466e+39)",
> "maxRowCount": -1
> }
> {noformat}|{noformat}
> 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>
> {noformat}
> |Out of range 2|{noformat}
> request:
> {"request":"prepareAndExecute","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","sql":"UPSERT
> INTO SEN.FLOAT_TABLE(KeyColumn, Column1)
> VALUES('ConversionTestKey',2.2250738585072014e-308)","maxRowCount":-1}
> {noformat}|{noformat}
> {"response":"Service$ExecuteResponse","results":[{"response":"resultSet","connectionId":"29770bfd-c923-712e-40b3-b097d4348A2F","statementId":1020495346,"ownStatement":false,"signature":null,"firstFrame":null,"updateCount":1}]}
> {noformat}|
> The three cases differ only in the value being inserted for Column1. In the
> last case, ('ConversionTestKey', 0) is inserted whereas an error should be
> reported
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)