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

NullPointer Exception on jdbc source using limit 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10.0, 1.11.0, 1.12.0
    • None
    • Metadata, Storage - JDBC
    • None
    • mariadb 10.0.29
      OpenJDK build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11

    Description

      Querying a jdbc datasource in a 2 node cluster when 1 node is down throws an exception when 'limit 0' is used to discover the schema:

      0: jdbc:drill:zk=localhost:2181> !verbose
      verbose: on
      0: jdbc:drill:zk=localhost:2181> select * from mysql.drill_mysql_test.person limit 1;
      +-----------+------------+-----------+---------+------+-------+-----+------+--------------+----------------+---------------+---------------+--------------+-------------+------------+------------+-----------------+------------+----------------+------------+------------+-----------------+-------------------+-----------------+------------+-----------+------------+
      | person_id | first_name | last_name | address | city | state | zip | json | bigint_field | smallint_field | numeric_field | boolean_field | double_field | float_field | real_field | time_field | timestamp_field | date_field | datetime_field | year_field | text_field | tiny_text_field | medium_text_field | long_text_field | blob_field | bit_field | enum_field |
      +-----------+------------+-----------+---------+------+-------+-----+------+--------------+----------------+---------------+---------------+--------------+-------------+------------+------------+-----------------+------------+----------------+------------+------------+-----------------+-------------------+-----------------+------------+-----------+------------+
      | 1 | first_name_1 | last_name_1 | 1401 John F Kennedy Blvd | Philadelphia | PA | 19107 | { a : 5, b : 6 } | 123456789 | 1 | 10.01 | false | 1.0 | 1.1 | 1.2 | 12:00:01 | 2012-02-29 12:00:01.0 | 2012-02-29 | 2012-02-29 12:00:01.0 | 2015-01-01 | It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout | xxx | a medium piece of text | a longer piece of text this is going on..... | [B@79c5636f | true | XXX |
      +-----------+------------+-----------+---------+------+-------+-----+------+--------------+----------------+---------------+---------------+--------------+-------------+------------+------------+-----------------+------------+----------------+------------+------------+-----------------+-------------------+-----------------+------------+-----------+------------+
      1 row selected (0,257 seconds)
      0: jdbc:drill:zk=localhost:2181> select * from mysql.drill_mysql_test.person limit 0;
      Error: SYSTEM ERROR: NullPointerException
      
      
      [Error Id: 977858d8-ed05-4a94-a28b-931ee870826f on localhost:31010] (state=,code=0)
      java.sql.SQLException: SYSTEM ERROR: NullPointerException
      
      
      [Error Id: 977858d8-ed05-4a94-a28b-931ee870826f on localhost:31010]
      	at org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:489)
      	at org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:561)
      	at org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1895)
      	at org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:61)
      	at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:473)
      	at org.apache.drill.jdbc.impl.DrillMetaImpl.prepareAndExecute(DrillMetaImpl.java:1100)
      	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
      	at org.apache.drill.jdbc.impl.DrillConnectionImpl.prepareAndExecuteInternal(DrillConnectionImpl.java:180)
      	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:109)
      	at org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:121)
      	at org.apache.drill.jdbc.impl.DrillStatementImpl.execute(DrillStatementImpl.java:101)
      	at sqlline.Commands.execute(Commands.java:841)
      	at sqlline.Commands.sql(Commands.java:751)
      	at sqlline.SqlLine.dispatch(SqlLine.java:746)
      	at sqlline.SqlLine.begin(SqlLine.java:621)
      	at sqlline.SqlLine.start(SqlLine.java:375)
      	at sqlline.SqlLine.main(SqlLine.java:268)
      Caused by: org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: NullPointerException
      
      
      [Error Id: 977858d8-ed05-4a94-a28b-931ee870826f on localhost:31010]
      	at org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
      	at org.apache.drill.exec.rpc.user.UserClient.handle(UserClient.java:343)
      	at org.apache.drill.exec.rpc.user.UserClient.handle(UserClient.java:88)
      	at org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:274)
      	at org.apache.drill.exec.rpc.RpcBus$InboundHandler.decode(RpcBus.java:244)
      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
      	at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            korlawulki Holger Kiel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: