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

ASF GitHub Bot commented on DRILL-4128:
---------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/353


> 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, 1.4.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)

Reply via email to