Code Monkey home page Code Monkey logo

Comments (8)

jovezhong avatar jovezhong commented on July 17, 2024

Root cause is the com.clickhouse.jdbc.ClickhouseDrver will call this SQL as part of the connection setup. We need to change the SQL

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

Pls change the SQL during JDBC connection setup. This blocks other Java based integration.

I can update the code if you can advise what SQL to change

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

I am going to fix the JDBC driver myself.

A working SQL can be

select 'default' as currentUser, timezone(), version(),if_null((select to_uint8(value) from system.settings where name='readonly'),0) as readonly

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

After changing the SQL and I got the other error for Nullable

Exception in thread "main" java.lang.ExceptionInInitializerError
at com.clickhouse.client.http.ClickHouseHttpClient.postRequest(ClickHouseHttpClient.java:90)
at com.clickhouse.client.http.ClickHouseHttpClient.execute(ClickHouseHttpClient.java:114)
at com.clickhouse.client.ClickHouseRequest.execute(ClickHouseRequest.java:1385)
at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.getServerInfo(ClickHouseConnectionImpl.java:78)
at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.(ClickHouseConnectionImpl.java:245)
at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.(ClickHouseConnectionImpl.java:213)
at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:145)
at com.clickhouse.jdbc.ClickHouseDriver.connect(ClickHouseDriver.java:41)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:230)
at test_jdbc_driver.App.dropAndCreateTable(App.java:17)
at test_jdbc_driver.App.main(App.java:85)
Caused by: java.lang.IllegalArgumentException: Unknown data type: Nullable
at com.clickhouse.client.ClickHouseDataType.of(ClickHouseDataType.java:186)
at com.clickhouse.client.ClickHouseColumn.readColumn(ClickHouseColumn.java:342)
at com.clickhouse.client.ClickHouseColumn.of(ClickHouseColumn.java:388)
at com.clickhouse.client.data.ClickHouseStreamResponse.(ClickHouseStreamResponse.java:30)

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

further changed Nullable and I got "java.sql.SQLFeatureNotSupportedException: Sorry this driver only supports ClickHouse server 20.7 or above"

Then I changed the version to 21

The JDBC connection can be setup but running select * from table(car_live_data) limit 10 failed with

Apr. 05, 2022 10:51:34 P.M. com.clickhouse.client.data.ClickHouseStreamResponse
SEVERE: Failed to create stream response, closing input stream
java.sql.SQLException: Reached end of input stream after reading 28 of 46 bytes, server ClickHouseNode(addr=http:localhost/:8123, db=default)@-966655878
at com.clickhouse.jdbc.SqlExceptionUtils.handle(SqlExceptionUtils.java:55)
at com.clickhouse.jdbc.SqlExceptionUtils.handle(SqlExceptionUtils.java:70)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.getLastResponse(ClickHouseStatementImpl.java:81)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:268)
at test_jdbc_driver.App.query(App.java:19)
at test_jdbc_driver.App.main(App.java:35)
Caused by: java.io.IOException: Reached end of input stream after reading 28 of 46 bytes
at com.clickhouse.client.ClickHouseInputStream.readBytes(ClickHouseInputStream.java:683)
at com.clickhouse.client.data.ClickHouseLZ4InputStream.read(ClickHouseLZ4InputStream.java:207)
at com.clickhouse.client.ClickHouseInputStream.readString(ClickHouseInputStream.java:724)
at com.clickhouse.client.ClickHouseInputStream.readUnicodeString(ClickHouseInputStream.java:761)
at com.clickhouse.client.data.ClickHouseRowBinaryProcessor.readColumns(ClickHouseRowBinaryProcessor.java:572)
at com.clickhouse.client.ClickHouseDataProcessor.(ClickHouseDataProcessor.java:96)
at com.clickhouse.client.data.ClickHouseRowBinaryProcessor.(ClickHouseRowBinaryProcessor.java:586)
at com.clickhouse.client.ClickHouseDataStreamFactory.getProcessor(ClickHouseDataStreamFactory.java:47)
at com.clickhouse.client.data.ClickHouseStreamResponse.(ClickHouseStreamResponse.java:77)
at com.clickhouse.client.data.ClickHouseStreamResponse.of(ClickHouseStreamResponse.java:54)
at com.clickhouse.client.http.ClickHouseHttpClient.postRequest(ClickHouseHttpClient.java:90)
at com.clickhouse.client.http.ClickHouseHttpClient.execute(ClickHouseHttpClient.java:114)
at com.clickhouse.client.ClickHouseRequest.execute(ClickHouseRequest.java:1385)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.getLastResponse(ClickHouseStatementImpl.java:76)

Event select 1 failed

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

Update: Ken fixed the proton and also patches the JDBC driver. I added one more change and now pure JDBC is okay, and dbeaver is okay. But airbyte is blocked with other reasons

DBeaver UI
image

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

JDBC driver is basically. However I still cannot make the airbyte connector working.

  • the airbyte destination (send data to timeplus), will create temp table, then insert to the temp table, then insert into .. as select, then drop the temp table. For example reason, no data is inserted. Need to check whether JDBC issue or my connector code issue
  • airbyte source (read from timeplus), hang when loading schema

but I will close this ticket

from proton-java-driver.

jovezhong avatar jovezhong commented on July 17, 2024

(Jove Github Bot) moved this ticket out of the GitHub project(up to 1200 tickets for one project).

from proton-java-driver.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.