ejc-sql icon indicating copy to clipboard operation
ejc-sql copied to clipboard

Cloudera Impala JDBC support?

Open jqtruong opened this issue 1 year ago • 4 comments

hello, i'm not sure what i'm doing wrong but upon ejc-connect, i get:

Connection started...
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.0.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.32.0-alpha3\"\] -- repl :headless :host localhost
Starting nREPL server for ejc-sql...
[nREPL] server started on 61233
[nREPL] Establishing direct connection to localhost:61233 ...
[nREPL] Direct connection to localhost:61233 established
error in process filter: split-string: Wrong type argument: stringp, nil
error in process filter: Wrong type argument: stringp, nil
Connected! The only way of discovering the limits of the possible is to venture a little way past them into the impossible. -Arthur C. Clarke

and my connection is:

(ejc-create-connection
 "a-conn"
  :connection-uri "jdbc:impala:/my.server.com:21050?db=some_db&user=myuser&password=mypass;AuthMech=3;SSL=1;UseNativeQuery=1;"
 :classpath "<some path>/cloudera-jdbc-drivers/lib/2.6.30.1036/ImpalaJDBC42-2.6.30.1036.jar"
 )

it says i'm connected at the end but there is no buffer for me to run queries. Might y'all know what i'm doing wrong?

jqtruong avatar Jul 21 '23 22:07 jqtruong

actually, i found the result-file and saw another error:

Error: No suitable driver found for jdbc:impala://my.impala.server:21050;AuthMech=3;SSL=1;UseNativeQuery=1;

jqtruong avatar Jul 24 '23 16:07 jqtruong

my updated connection config:

 :classpath "<path to jar>/cloudera-jdbc-drivers/lib/2.6.30.1036/ImpalaJDBC42-2.6.30.1036.jar"
 :classname "com.cloudera.impala.jdbc.Driver"
 :connection-uri "jdbc:impala://my.impala.server:21050;AuthMech=3;SSL=1;UseNativeQuery=1;"

i also added config for :dbname, :user, and :password but not necessary to show y'all that. FYI, the user and pw in the connection string would be: UID and PWD.

jqtruong avatar Jul 24 '23 16:07 jqtruong

the issue with the split string is because i didn't put the jdbc jar under ~/.m2/repository/ so that's fixed, and the error in the backtrace now is:

error in process filter: Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445).
com.cloudera.impala.jdbc.Driver

but i see the class if i unzip the jar, at: com/cloudera/impala/jdbc/Driver.class.

jqtruong avatar Jul 24 '23 17:07 jqtruong

@jqtruong unfortunately, I don't have Cloudera Impala database installed. Could you please try to use dependencies instead of classpath in the configuration:

:dependencies [[Impala/ImpalaJDBC42 "2.6.26.1031"]]

kostafey avatar Aug 16 '23 20:08 kostafey