drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Devender Yadav (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-4128) null pointer at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)
Date Fri, 08 Jan 2016 09:11:39 GMT

     [ https://issues.apache.org/jira/browse/DRILL-4128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Devender Yadav  updated DRILL-4128:
-----------------------------------
    Description: 
While fetching data from ResultSet in JDBC. I got the null pointer. Details - 

java.lang.NullPointerException
at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)
at org.apache.drill.exec.vector.accessor.BoundCheckingAccessor.getString(BoundCheckingAccessor.java:124)
at org.apache.drill.jdbc.impl.TypeConvertingSqlAccessor.getString(TypeConvertingSqlAccessor.java:649)
at org.apache.drill.jdbc.impl.AvaticaDrillSqlAccessor.getString(AvaticaDrillSqlAccessor.java:95)
at net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:205)
at org.apache.drill.jdbc.impl.DrillResultSetImpl.getString(DrillResultSetImpl.java:182)

Below mentioned method is throwing null pointer becaue getObject(rowOffset) returns null for
null values & null.toString() is throwing null pointer.

 @Override
  public String getString(int rowOffset) throws InvalidAccessException{
    return getObject(rowOffset).toString();
  }

It should be like:

 @Override
  public String getString(int rowOffset) throws InvalidAccessException{
    return getObject(rowOffset)==null? null:getObject(rowOffset).toString();
  }

  was:
Below mentioned method is throwing null pointer becaue getObject(rowOffset) returns null for
null values & null.toString() is throwing null pointer.

java.lang.NullPointerException
at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)
at org.apache.drill.exec.vector.accessor.BoundCheckingAccessor.getString(BoundCheckingAccessor.java:124)
at org.apache.drill.jdbc.impl.TypeConvertingSqlAccessor.getString(TypeConvertingSqlAccessor.java:649)
at org.apache.drill.jdbc.impl.AvaticaDrillSqlAccessor.getString(AvaticaDrillSqlAccessor.java:95)
at net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:205)
at org.apache.drill.jdbc.impl.DrillResultSetImpl.getString(DrillResultSetImpl.java:182)

 @Override
  public String getString(int rowOffset) throws InvalidAccessException{
    return getObject(rowOffset).toString();
  }

It should be like:

 @Override
  public String getString(int rowOffset) throws InvalidAccessException{
    return getObject(rowOffset)==null? null:getObject(rowOffset).toString();
  }


> null pointer at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-4128
>                 URL: https://issues.apache.org/jira/browse/DRILL-4128
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>    Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0
>            Reporter: Devender Yadav 
>            Priority: Blocker
>             Fix For: Future
>
>
> While fetching data from ResultSet in JDBC. I got the null pointer. Details - 
> java.lang.NullPointerException
> at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)
> at org.apache.drill.exec.vector.accessor.BoundCheckingAccessor.getString(BoundCheckingAccessor.java:124)
> at org.apache.drill.jdbc.impl.TypeConvertingSqlAccessor.getString(TypeConvertingSqlAccessor.java:649)
> at org.apache.drill.jdbc.impl.AvaticaDrillSqlAccessor.getString(AvaticaDrillSqlAccessor.java:95)
> at net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:205)
> at org.apache.drill.jdbc.impl.DrillResultSetImpl.getString(DrillResultSetImpl.java:182)
> Below mentioned method is throwing null pointer becaue getObject(rowOffset) returns null
for null values & null.toString() is throwing null pointer.
>  @Override
>   public String getString(int rowOffset) throws InvalidAccessException{
>     return getObject(rowOffset).toString();
>   }
> It should be like:
>  @Override
>   public String getString(int rowOffset) throws InvalidAccessException{
>     return getObject(rowOffset)==null? null:getObject(rowOffset).toString();
>   }



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

Mime
View raw message