kostafey / ejc-sql

Emacs SQL client uses Clojure JDBC.
278 stars 29 forks source link

Cloudera Impala JDBC support? #179

Open jqtruong opened 1 year ago

jqtruong commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

kostafey commented 1 year ago

@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"]]