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

Arina Ielchiieva reassigned DRILL-4984:
---------------------------------------

    Assignee: Vitalii Diravka

> Limit 0 raises NullPointerException on JDBC storage sources
> -----------------------------------------------------------
>
>                 Key: DRILL-4984
>                 URL: https://issues.apache.org/jira/browse/DRILL-4984
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.12.0
>         Environment: Latest 1.9 release also 1.8 release version,
> mysql-connector-java-5.1.30, mysql-connector-java-5.1.40
>            Reporter: Holger Kiel
>            Assignee: Vitalii Diravka
>            Priority: Major
>             Fix For: 1.15.0
>
>
> NullPointerExceptions occur when a query with 'limit 0' is executed on a jdbc 
> storage source (e.g. Mysql):
> {code}
> 0: jdbc:drill:zk=local> select * from mysql.sugarcrm.sales_person limit 0;
> Error: SYSTEM ERROR: NullPointerException
> [Error Id: 6cd676fc-6db9-40b3-81d5-c2db044aeb77 on localhost:31010]
>   (org.apache.drill.exec.work.foreman.ForemanException) Unexpected exception 
> during fragment initialization: null
>     org.apache.drill.exec.work.foreman.Foreman.run():281
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1142
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():617
>     java.lang.Thread.run():745
>   Caused By (java.lang.NullPointerException) null
>     
> org.apache.drill.exec.planner.sql.handlers.FindHardDistributionScans.visit():55
>     org.apache.calcite.rel.core.TableScan.accept():166
>     org.apache.calcite.rel.RelShuttleImpl.visitChild():53
>     org.apache.calcite.rel.RelShuttleImpl.visitChildren():68
>     org.apache.calcite.rel.RelShuttleImpl.visit():126
>     org.apache.calcite.rel.AbstractRelNode.accept():256
>     org.apache.calcite.rel.RelShuttleImpl.visitChild():53
>     org.apache.calcite.rel.RelShuttleImpl.visitChildren():68
>     org.apache.calcite.rel.RelShuttleImpl.visit():126
>     org.apache.calcite.rel.AbstractRelNode.accept():256
>     
> org.apache.drill.exec.planner.sql.handlers.FindHardDistributionScans.canForceSingleMode():45
>     
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel():262
>     
> org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToDrel():290
>     org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():168
>     org.apache.drill.exec.planner.sql.DrillSqlWorker.getPhysicalPlan():123
>     org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():97
>     org.apache.drill.exec.work.foreman.Foreman.runSQL():1008
>     org.apache.drill.exec.work.foreman.Foreman.run():264
>     java.util.concurrent.ThreadPoolExecutor.runWorker():1142
>     java.util.concurrent.ThreadPoolExecutor$Worker.run():617
>     java.lang.Thread.run():745 (state=,code=0)
> 0: jdbc:drill:zk=local> select * from mysql.sugarcrm.sales_person limit 1;
> +-----+-------------+----------------+------------+-------------+
> | id  | first_name  |   last_name    | full_name  | manager_id  |
> +-----+-------------+----------------+------------+-------------+
> | 1   | null        | Administrator  | admin      | 0           |
> +-----+-------------+----------------+------------+-------------+
> 1 row selected (0,235 seconds)
> {code}
> Other datasources are okay:
> {code}
> 0: jdbc:drill:zk=local> SELECT * FROM cp.`employee.json` LIMIT 0;
> +------+-----------+-----------+---------+--------------+------------+-------------+------------+--------------+-----------------+-----------+----------------+-------------+------------+---------+----------------+------------------+-----------------+---------+------------------+
> | fqn  | filename  | filepath  | suffix  | employee_id  | full_name  | 
> first_name  | last_name  | position_id  | position_title  | store_id  | 
> department_id  | birth_date  | hire_date  | salary  | supervisor_id  | 
> education_level  | marital_status  | gender  | management_role  |
> +------+-----------+-----------+---------+--------------+------------+-------------+------------+--------------+-----------------+-----------+----------------+-------------+------------+---------+----------------+------------------+-----------------+---------+------------------+
> +------+-----------+-----------+---------+--------------+------------+-------------+------------+--------------+-----------------+-----------+----------------+-------------+------------+---------+----------------+------------------+-----------------+---------+------------------+
> No rows selected (0,309 seconds)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to