You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2017/07/17 21:02:00 UTC

[jira] [Created] (DRILL-5673) NPE from planner when using a table function with an invalid table

Paul Rogers created DRILL-5673:
----------------------------------

             Summary: NPE from planner when using a table function with an invalid table
                 Key: DRILL-5673
                 URL: https://issues.apache.org/jira/browse/DRILL-5673
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.10.0
            Reporter: Paul Rogers


Create a CSV file, with headers and call it "data_3.csv."

Set up a storage plugin config with headers, delimiter of ",". Call it "myws". Then read the file:

{code}
SELECT * FROM `dfs.myws`.`data_3.csv`
{code}

This query works.

Try the same with a table function:

{code}
SELECT * FROM table(dfs.myws.`data_3.csv` (type => 'text', fieldDelimiter => ',' , extractHeader => true))
{code}

This also works.

Now, let's use an incorrect name:

{code}
SELECT * FROM `dfs.myws`.`data_33.csv`
{code}

(Note the "33" in the name.)

This produces an error to the client:

Now the bug. Do the same thing with the table function:

{code}
SELECT * FROM table(dfs.myws.`data_33.csv` (type => 'text', fieldDelimiter => ',' , extractHeader => true))
{code}

This results in an NPE:

{code}
org.apache.drill.common.exceptions.UserRemoteException: VALIDATION ERROR: null

SQL Query null

[Error Id: cf151c28-9879-4ecc-893a-78d85a11c2f4 on 10.250.50.74:31010]
	at org.apache.drill.exec.rpc.user.QueryResultHandler.resultArrived(QueryResultHandler.java:123)
...

Caused by: java.lang.NullPointerException: null
	at org.apache.drill.exec.planner.logical.DrillTranslatableTable.getRowType(DrillTranslatableTable.java:49) ~[classes/:na]
	at org.apache.calcite.sql.validate.ProcedureNamespace.validateImpl(ProcedureNamespace.java:68) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:883) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:869) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2806) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2791) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3014) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:883) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:869) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
	at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:210) ~[calcite-core-1.4.0-drill-r21.jar:1.4.0-drill-r21]
...
{code}

This bug causes much user confusion as the user cannot immediately tell that this is "user error" vs. something terribly wrong with Drill.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)