ClickHouse/clickhouse-java

Socket timeout being used as Future wait

kuhnen opened this issue · 2 comments

In the ClickhouseClient file, specifically on line 878, the following code is present:

return execute(sealedRequest).get(sealedRequest.getConfig().getSocketTimeout(), TimeUnit.MILLISECONDS);

return execute(sealedRequest).get(sealedRequest.getConfig().getSocketTimeout(), TimeUnit.MILLISECONDS);
I have encountered an issue where there appears to be no way to override this setting when using the spark-clickhouse-connector.

Would it be possible to introduce a method to override this parameter, perhaps through an environment variable? Additionally, it would be beneficial to consider renaming the property, as its current name (socket_timeout) does not accurately reflect its functionality.

Good day, @kuhnen !
Is it possible to use Future method like

request.query(sql).execute().get(timeout, TimeUnit.MILLISECONDS);

I'm referring to this method com.clickhouse.client.ClickHouseRequest#execute

Thanks!

Good day, @chernser! :)

Thank you for your response.

I understand your suggestion and have already created a fork and deployed a local jar to work with the spark-clickhouse-connector. However, I’m wondering if it might be possible to introduce a solution that allows this timeout value to be configured via an environment variable or a configuration file.

Additionally, I’m curious if the name socket_timeout is the best fit for this property, considering its usage in this context. Perhaps renaming it to something more indicative of its purpose could be beneficial.

Thanks again for your support!