Kevin Liew created PHOENIX-2393:
-----------------------------------

             Summary: Cannot retrieve any data from a table with a null date
                 Key: PHOENIX-2393
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2393
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.5.0
            Reporter: Kevin Liew


Create a table
{noformat}
DROP TABLE IF EXISTS Date_Table;
CREATE TABLE IF NOT EXISTS Date_Table(
        KeyColumn CHAR(255) PRIMARY KEY,
        Column1 DATE);
{noformat}

Import a csv containing a null date
{noformat}
"Null",
{noformat}

Try any 'select' query on the table

{noformat}
select * from date_table
{noformat}

The server logs
{noformat}
2015-11-09 21:30:57,053 WARN org.eclipse.jetty.server.HttpChannel: /
java.lang.NullPointerException
        at java.util.Calendar.setTime(Calendar.java:1106)
        at 
org.apache.phoenix.jdbc.PhoenixResultSet.getDate(PhoenixResultSet.java:386)
        at 
org.apache.calcite.avatica.jdbc.JdbcResultSet.getValue(JdbcResultSet.java:107)
        at 
org.apache.calcite.avatica.jdbc.JdbcResultSet.frame(JdbcResultSet.java:77)
        at org.apache.calcite.avatica.jdbc.JdbcMeta.fetch(JdbcMeta.java:770)
        at 
org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:163)
        at 
org.apache.calcite.avatica.remote.Service$FetchRequest.accept(Service.java:330)
        at 
org.apache.calcite.avatica.remote.Service$FetchRequest.accept(Service.java:304)
        at 
org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:43)
        at 
org.apache.calcite.avatica.server.AvaticaHandler.handle(AvaticaHandler.java:55)
        at 
org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:497)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
        at 
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)

{noformat}



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

Reply via email to