Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4128

null pointer at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getString(AbstractSqlAccessor.java:101)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0
    • 1.5.0
    • Client - JDBC
    • None
    • Important

    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(); }

      Attachments

        Activity

          People

            jaltekruse Jason Altekruse
            dev17892 Devender Yadav
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: