1

I have a custom datasource driver in JetBrans (Rider 2019.2) which uses apache-drill-1.17.jar JDBC driver (official).

Using the driver results in this error:

SELECT * FROM dfs.my_parquets."Test" limit 10;
--
PARSE ERROR: Lexical error at line 1, column 19. Encountered: "`" (96), after : ""  
SQL Query: ALTER SESSION SET `exec.query.max_rows`=501 

From the error is obvious that Rider tries to execute this hidden query with backticked identifiers:

ALTER SESSION SET `exec.query.max_rows`=501

The problem is that the quoting_identifiers in target drill are not set to ` (backtick) but to " (double quote).

As a connection string I'm using this: jdbc:drill:drillbit=my-drill-instance;quoting_identifiers='"'

Is there a way to tell the driver to use double quotes in the hidden queries?

rudolfdobias
  • 1,778
  • 3
  • 17
  • 40
  • At the moment there is no way to change quotes directly. I filed an [issue DBE-10801](https://youtrack.jetbrains.com/issue/DBE-10801) based on your description. – Vasilii Chernov May 16 '20 at 07:35

1 Answers1

0

Manual shows, that option should be passed without quotes:

jdbc:drill:zk=local;quoting_identifiers=[

jdbc:drill:drillbit=my-drill-instance;quoting_identifiers="

Vasilii Chernov
  • 1,169
  • 8
  • 17
  • I tried that. This example throws error: `Connect string 'drillbit=my-drillbit;quoting_identifiers="' contains unterminated quoted value ''` – rudolfdobias May 18 '20 at 14:30
  • 1
    My bad, correct one is `jdbc:drill:drillbit=localhost;quoting_identifiers='"'`. But there is an issue in Drill JDBC driver to set correct `LIMIT` value. As a workaround turn off **Limit page size to** option in _Preferences_ → _Database_ → _Data Views_ and set it manually for your queries. E.g.: `SELECT * FROM cp."employee.json" LIMIT 100`. – Vasilii Chernov May 19 '20 at 09:39
  • Also, you can skip _quoting_identifiers_ option and set it per session `ALTER SESSION SET planner.parser.quoting_identifiers = '"'`. – Vasilii Chernov May 19 '20 at 09:41