phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2454) Upsert with Double.NaN returns NumberFormatException
Date Tue, 19 Jan 2016 03:09:39 GMT

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

ASF GitHub Bot commented on PHOENIX-2454:
-----------------------------------------

Github user chuxi commented on the pull request:

    https://github.com/apache/phoenix/pull/148#issuecomment-172724839
  
    the test. 
    
    ![screen shot 2016-01-19 at 11 05 41 am](https://cloud.githubusercontent.com/assets/5573798/12408593/ee4365f8-be9c-11e5-93f7-256476021cbd.png)
    
    
    <img width="493" alt="screen shot 2016-01-19 at 11 08 23 am" src="https://cloud.githubusercontent.com/assets/5573798/12408604/01141ae2-be9d-11e5-9e52-7876f734dcfa.png">
    



> Upsert with Double.NaN returns NumberFormatException
> ----------------------------------------------------
>
>                 Key: PHOENIX-2454
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2454
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: alex kamil
>            Priority: Minor
>
> When saving Double.NaN via prepared statement into column of type Double getting NumberFormatException
(while expected behavior is saving null)
> test case:
> {code}
> import java.sql.*;
> public static void main(String [] args){
>   try {
> 	  Connection phoenixConnection = DriverManager.getConnection("jdbc:phoenix:localhost");
> 	  String sql  = "CREATE TABLE test25 (id BIGINT not null primary key,  col1 double,
col2 double)";
> 	  Statement stmt = phoenixConnection.createStatement();
> 	  stmt.executeUpdate(sql);
> 	  phoenixConnection.commit();
> 	  
> 	  sql = "UPSERT INTO test25 (id, col1,col2) VALUES (?,?,?)";
> 	  PreparedStatement ps = phoenixConnection.prepareStatement(sql);
> 	  ps.setInt(1, 12);
> 	  ps.setDouble(2, 2.5);
> 	  ps.setDouble(3, Double.NaN);
> 	  ps.executeUpdate();
> 	  phoenixConnection.commit();
> 	  phoenixConnection.close();
> 	  } catch (Exception e) {
> 	         e.printStackTrace();
> 	  }
> }
> {code}



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

Mime
View raw message