metabase-clickhouse-driver icon indicating copy to clipboard operation
metabase-clickhouse-driver copied to clipboard

Clickhouse DB Additional JDBC options

Open ADovgalyuk opened this issue 2 years ago • 6 comments

Hello, Not exactly a bug but more of a consultation. I don't see advanced options for clickhouse on latest 42.1 anymore, as we had on 39.X. Why and when was it removed, should we create a task in metabase in order to return it back? image

ADovgalyuk avatar Feb 28 '22 09:02 ADovgalyuk

Same problem on our side. Is it possible to get it back? We would like to set socket_timeout=xxxx but it seems not possible without the dedicated JDBC options.

saimon46 avatar Mar 29 '22 12:03 saimon46

The JDBC driver has undergone some major changes. I hope that I will be able to integrate the new version and also make options work nicely.

Unfortunately, there were some breaking changes to meta data :cry:

enqueue avatar Mar 29 '22 16:03 enqueue

You still can edit system database, where in table metabase_database for clickhose row in details column in json add next values. "advanced-options":true,"additional-options":"socket_timeout=42000000&connect_timeout=42000000&receive_timeout=42000000&send_timeout=42000000"

webver avatar May 08 '22 18:05 webver

@webver Thanks for the tip but in that db, the in the column defails I see only crypted characters. I guess because that column is crypted. Isn't it?

saimon46 avatar Jun 01 '22 13:06 saimon46

Ran into this issue as well, and like @saimon46 said the db is encrypted.

Solved this by updating the database via the API. What I suggest is that you go to the database page on the admin, don't change anything, and hit "save'. Capture the request in in your browser's dev tools. You'll see the body was something like:

{"engine":"clickhouse","name":"NAME","details":{"dbname":"DBNAME","host":"HOST","port":PORT,"user":"USER","password":"PASSWORD","ssl":true},"is_full_sync":true,"is_on_demand":false}

Add the "additional-options" inside the details object, so you'd end up with:

{"engine":"clickhouse","name":"NAME","details":{"dbname":"DBNAME","host":"HOST","port":PORT,"user":"USER","password":"PASSWORD","ssl":true,"additional-options":"socket_timeout=300000"},"is_full_sync":true,"is_on_demand":false}

Which you should be able to send (either via curl or by re-issuing the modified request, if your browser supports that)

karlseguin avatar Jun 02 '22 06:06 karlseguin

Ran into this issue as well, and like @saimon46 said the db is encrypted.

Solved this by updating the database via the API. What I suggest is that you go to the database page on the admin, don't change anything, and hit "save'. Capture the request in in your browser's dev tools. You'll see the body was something like:

{"engine":"clickhouse","name":"NAME","details":{"dbname":"DBNAME","host":"HOST","port":PORT,"user":"USER","password":"PASSWORD","ssl":true},"is_full_sync":true,"is_on_demand":false}

Add the "additional-options" inside the details object, so you'd end up with:

{"engine":"clickhouse","name":"NAME","details":{"dbname":"DBNAME","host":"HOST","port":PORT,"user":"USER","password":"PASSWORD","ssl":true,"additional-options":"socket_timeout=300000"},"is_full_sync":true,"is_on_demand":false}

Which you should be able to send (either via curl or by re-issuing the modified request, if your browser supports that)

Thx, it works.

FesonX avatar Aug 22 '22 01:08 FesonX