chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse

Home Page:https://clickhouse.com/docs/en/chdb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can support jdbc bridge?

wonb168 opened this issue · comments

has a clickhouse-jdbc-bridge,can chdb support this?

此表函数需要单独的 clickhouse-jdbc-bridge 程序才能运行?

You don't need a standalone clickhouse-jdbc-bridge

I tested, need install and start jdbc-bridge first:

#%%
import chdb
print(chdb.__version__)
# %%
#postgres://hvycjfbu:xVPOX-3ftwx3Mi9DJ_u-iBaN8bIwJXQt@john.db.elephantsql.com:5432/hvycjfbu
url="jdbc:postgres://hvycjfbu:xVPOX-3ftwx3Mi9DJ_u-iBaN8bIwJXQt@john.db.elephantsql.com:5432/hvycjfbu"
sql="select version()"
sql=f"""SELECT * FROM jdbc('{url}', '${sql}')"""
res = chdb.query(sql, 'Dataframe')
print(res)
# %%

raise error:

ChdbError: Code: 410. DB::Exception: clickhouse-jdbc-bridge is not running. Please, start it manually. (EXTERNAL_SERVER_IS_NOT_RESPONDING)

I did double check in the code. It seems JDBC will need clickhouse-jdbc-bridge started first, but ODBC does not need.