drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sudheesh Katkam (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4984) Limit 0 raises NullPointerException on JDBC storage sources
Date Fri, 18 Nov 2016 17:47:58 GMT

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

Sudheesh Katkam commented on DRILL-4984:
----------------------------------------

The issue can be reproduced with a simple unit test. In TestJdbcPluginWithDerbyIT, add this
test. and then run “mvn install” in the storage-jdbc sub-project.

{code}
@Test // DRILL-4984
public void limit0() throws Exception {
	testNoResult("SELECT * FROM derby.DRILL_DERBY_TEST.PERSON LIMIT 0");
}
{code}

Adding a check for null may not be sufficient (I could be wrong) because the check does not
imply if “contains” should be set to true/false. The call to unwrap() returns a different
type of table (not DrillTable or DrillTranslatableTable), and that may need to be investigated.


> 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
>         Environment: Latest 1.9 Snapshot, also 1.8 release version,
> mysql-connector-java-5.1.30, mysql-connector-java-5.1.40
>            Reporter: Holger Kiel
>
> 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
(v6.3.4#6332)

Mime
View raw message