Open wonb168 opened 1 month ago
You can use the jdbc table function: https://clickhouse.com/docs/en/sql-reference/table-functions/jdbc
此表函数需要单独的 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.
has a clickhouse-jdbc-bridge,can chdb support this?