Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickhouse JDBC driver support #80

Open
rodabt opened this issue Aug 18, 2020 · 6 comments
Open

Clickhouse JDBC driver support #80

rodabt opened this issue Aug 18, 2020 · 6 comments

Comments

@rodabt
Copy link

rodabt commented Aug 18, 2020

Hi all,

I'm trying to use Poli with Clickhouse using the official JDBC driver, but after setting parameters it shows an Internal Server error message in Poli:

Internal Server Error: org/apache/http/conn/ConnectionKeepAliveStrategy

I've tried increasing JDBC parameters like connect_timeout and similar to no avail.

Is there any workaround?

Thanks!

@shzlw
Copy link
Owner

shzlw commented Aug 19, 2020

Hey, thanks for using Poli.

I can reproduce your issue. It throws a no class found error when I try to test the connection because it cannot find the httpclientcomponent dependency the jdbc driver needs. The root cause is the clickhouse jdbc in maven has no dependencies included.

Here is how I fix it.

My environment:

  • Ubuntu 20.04
  • OpenJDK 11.0.8
  • Poli 0.12.2
  • Latest Clickhouse server and client

Steps:

  1. I followed the instructions on clickhouse website to install database, set a root password and create a database called tutorial.
  2. I cloned clickhouse jdbc source code from its git repo.
  3. If you go to that page and scroll down, you will see a command to build a jar with dependencies. When I run it, it gives me an error complaining about javadocs. To bypass that, I just modify the pom.xml and removed the following piece between line 171-183.
          <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
  1. After removing that block, I run the the command again and it generates a jar called clickhouse-jdbc-0.2.4-jar-with-dependencies.jar under target folder.
  2. I copied it to poli-0.12.2/jdbc-drivers folder, started the server and the test connection works for me.

Here is my datasource setup
ds

@shzlw shzlw added question Further information is requested and removed to investigate question Further information is requested labels Aug 19, 2020
@rodabt
Copy link
Author

rodabt commented Aug 19, 2020

Hi shzlw! Thanks for looking at it. Poli it's a wonderful product!

I followed your suggestions and generated a new jar with all dependencies. Copied that to jdbc-drivers, but after I restarted poli it throws a new error:

Internal Server Error: com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()Z

By the way, I'm using the docker version of Poli....and Windows 10

@rodabt
Copy link
Author

rodabt commented Aug 19, 2020

Tried again again with a fresh new install of Ubuntu 20.04 (on Docker), latest openjdk-11 and latest poli (0.12.2).

Cloned jdbc driver to that machine and generated .jar with dependencies using mvn, excluding javadoc dependency portion. Still the getting same error: Internal Server Error: 'boolean com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()'

@shzlw
Copy link
Owner

shzlw commented Aug 19, 2020

I only tested the data source connection by clicking the ping button. Did you get the exception when you try to ping the database or it happened when you tried to run a query in a report?

@rodabt
Copy link
Author

rodabt commented Aug 20, 2020

I only tested the data source connection by clicking the ping button. Did you get the exception when you try to ping the database or it happened when you tried to run a query in a report?

It happens after restarting during login. First I started the app, changed password, added the new driver, then restarted...and there appears the error when I try to login. Somehow the addition of that jar interferes with the login process...

@shzlw
Copy link
Owner

shzlw commented Aug 22, 2020

Docker in my Ubuntu is messed up. I will need to try it on my Mac. Please just try install Poli through release zip to see if you still get the error or it is Poli in docker specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants