Dan Wild
Dan Wild

Reputation: 36

Apache Drill JDBC Plugin Doesnt Recognize Columns

I'm attempting to query a proprietary RDBMS using Apache Drill. I've created the plugin as a JDBC data source and put my JDBC jar in the jars/3rdparty directory, and I'm able to successfully run a query such as SELECT * FROM mytable.

However, if I use a column name in the query such as SELECT mycol FROM mytable, Drill returns the following error: Error: VALIDATION ERROR: From line 1, column 8 to line 1, column 9: Column 'mycol' not found in any table. Moreover, I've noticed that my schema is entirely missing if I run SELECT * FROM INFORMATION_SCHEMA.SCHEMATA, so I have a hunch that Drill is unable to retrieve my database schema from the JDBC driver.

I'm wondering what method of the JDBC driver may be implemented incorrectly that's causing this problem. The JDBC driver has been used with other 3rd party software such as Spark with no issue.

Upvotes: 0

Views: 230

Answers (2)

ilooner
ilooner

Reputation: 2550

In order to perform a query on your table you need to prefix the name of your table with the name you gave your storage plugin. For example if you named your storage plugin rdbms your query should look like this:

SELECT * FROM rdbms.mytable

Your additional query SELECT * FROM INFORMATION_SCHEMA.SCHEMATA likely failed for the same reason. Try SELECT * FROM rdbms.INFORMATION_SCHEMA.SCHEMATA. And don't forget to replace rdbms with the name you gave your storage plugin.

Upvotes: 1

anji_rajesh
anji_rajesh

Reputation: 369

I think we should query on drill like select * from dfs.<storagePlugin>.tableName

Can you check once.?

Upvotes: 0

Related Questions