Skip to content

Error querying Informix database #3019

@skuhne-gesa

Description

@skuhne-gesa

Drill version 1.22.0

I am following up on these two issues reported here, which seem to perfectly sum up the errors I am encountering:
https://lists.apache.org/thread/dlv1ql981587g02w485lpmfbdo9jsfg8
https://issues.apache.org/jira/browse/DRILL-3180

Text of the issue I am referring to:

I tried to connect it to some INFORMIX database with something like this (named it "informix"):

{
"type": "jdbc",
"driver": "com.informix.jdbc.IfxDriver",
"url": "jdbc:informix-sqli://IP:PORT/sample_database:INFORMIXSERVER=sample_server;user=sample_user;password=sample_password",
"username": null,
"password": null,
"enabled": true
}

It successfully connects and gets me to list "schemas" and tables, but I cannot get queries to work because the SQL sent to the INFORMIX server looks like this:

SELECT *
FROM sample_database.sample_table

for a Drill query like this:

SELECT *
FROM informix.sample_database.sample_table

I think this error occurs because it is not necessary to qualify the table name with the database name. Worse than this, the appended database name gets the query sent to INFORMIX to fail.

How could I fix this? I tried to query from "informix.sample_table" table, but it gets me a "VALIDATION ERROR: informix.sample_table not found".

I myself tried the following syntax:

select * from table_name;
select * from storage_plugin_name.table_name;
select * from storage_plugin_name.db_name.table_name;
select * from storage_plugin_name.db_name.db_schema_name.table_name;
select * from storage_plugin_name.db_name:db_schema_name.table_name;
select * from storage_plugin_name.db_schema_name.table_name;
select * from db_name.db_schema_name.table_name;
select * from db_name:db_schema_name.table_name;
select * from db_schema_name.table_name;

Some of the syntax of course causes the "table not found error", while others create the below error:

User Error Occurred: The JDBC storage plugin failed while trying setup the SQL query.  (A syntax error has occurred.)
DATA_READ ERROR: The JDBC storage plugin failed while trying setup the SQL query. 

I am essentially wondering if I am on the wrong track wrt the syntax and what the correct syntax may be then?

Notes:

  • I have tried various combinations with back ticks "``", but certainly not all.
  • I am using the same JDBC driver as I use for the DBeaver Community Edition (which works perfectly fine).
  • I get the same behavior as the other users reporting this issue, i. e. I can see and list schemas and table names and use specific schemas, but cannot get to the data of a table.
  • Also similar behavior wrt the error logs where the "from" part is returned in the log with e. g. db_name and/or schema_name suddenly added when I originally entered it differently.
  • I get the errors both in the WEB UI and the Drill shell. Connecting to Drill via DBeaver creates a different error which seems to be of the same nature though: "SQL Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 58: Object 'DRILL' not found"

Any pointers are highly appreciated, thank you very much in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions