-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace deprecated clickhouse driver #4925
Replace deprecated clickhouse driver #4925
Conversation
A related issue(trinodb/trino#10541) |
4f10e21
to
6cc31d1
Compare
Looks generally good to me, but I wonder what are the implications for users, that still have the |
@zhicwu Can you help explain why you need to refactor the new driver? |
As you probably knew, ClickHouse spinout from Yandex was announced in late September 2021(details at here). Since then the official website was changed from https://clickhouse.tech to https://clickhouse.com, and docker images were moved from yandex to clickhouse. To follow the path, starting from v0.3.2, the JDBC driver started to use new package name and maven group id. From technical perspective, refactoring was discussed as in ClickHouse/clickhouse-java#570 and was kicked off since 0.3.0. Apart from that, it's worthy of mention that 0.3.2, unlike the version implied, is a complete re-write(primarily to address some fundemental issues). @kiview, the legacy JDBC driver(
We can revisit this later(maybe June / July?) to remove the warning message and retire the flag. |
@kiview Sorry for the delay. Even though you made a +1 in the above comment, I still need to confirm with you if you agree to do so? If you agree, I will update the current PR by this Sunday. Also thank you very much @zhicwu for your answers and suggestions for changes. |
The driver `ru.yandex.clickhouse.ClickHouseDriver` has been marked as deprecated. Also everything in package `ru.yandex.clickhouse` will be removed starting from 0.4.0.
6cc31d1
to
f785aa5
Compare
Updated. |
Thank you @tangjiangling. I'm all good with change. @kiview, appreciate if any of you can comment to move this forward. In case there's concern of mixing two drivers for one container, we can add |
@zhicwu @tangjiangling The driver dependency is only for the internal tests, there are no implications to the users (which I was thinking about in #4925 (comment)). The module should support the new driver without any changes to the code. The default no-args constructor is already deprecated, users should provide the image they want to use that is compatible with their driver. As such, I struggle to understand the need for this PR, at least with this amount of user-facing logs. It might be, that the original PR was fine, but I can't check this now. Sorry for the back and forth, but maybe we learned that the PR is not necessary in the first place. |
Thanks @kiview for the clarification. I think the confusing came from Does it make sense to only change below constant to Line 24 in 242dfde
Update:
Let me know if above looks good to you. I think we can hold the changes until |
I looked a bit more into our implementations and the interactions with our code to refresh my context on this PR. Indeed there is a use case where the value of @zhicwu What would you consider the most stable way to wait for ClickHouse to be ready? If we have a sufficiently stable log message, we can just configure it (in the same way we do it for Whatever we do or change, it would be helpful for me to understand the need from a module user perspective. As it is now, users can already get the So in order to better see where we need to go with this PR, I need to understand if this is about direct usage of |
It's direct private static ClickHouseContainer createContainer(DockerImageName image)
{
boolean latestDriverMinimumSupportedVersion = ClickHouseVersion.of(image.getVersionPart()).isNewerOrEqualTo(CLICKHOUSE_LATEST_DRIVER_MINIMUM_SUPPORTED_VERSION);
String driverClass = getClickhouseDriverClassName(latestDriverMinimumSupportedVersion);
return new ClickHouseContainer(image)
{
@Override
public String getDriverClassName()
{
return driverClass;
}
};
}
Yes, it's better to check logs than probing ports which may or may not be enabled. By default, you can watch Since user may customize the configuration, maybe it's better to check <clickhouse>
<logger>
<!-- Possible levels [1]:
- none (turns off logging)
- fatal
- critical
- error
- warning
- notice
- information
- debug
- trace
- test (not for production usage)
[1]: https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105-L114
-->
<level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
</logger>
</clickhouse> |
@zhicwu If you are using Regarding Also, note that CI is currently failing for the ClickHouse tests. Also, looking at something similar we had with MySQL in the past, I'd suggest a minimal implementation along the lines of #1760. |
As you probably know, the new Driver( I think the most critical issue is that the new driver is not well backward compatible (there may be some objective reasons for this). |
There is no obvious need for code interacting with Can you please point me at the code in Trino that interacts with |
trinodb/trino@8f59446#diff-ab0fd6dd2143f575dfbc2c3a631ebc4db19b2d1f9124ef58ce4c20a368764624R62-R81 Trino does not call Why do I submit this PR?
As I mentioned before, this is the key point. cc @zhicwu You can add if I'm wrong or didn't make a point. |
I'll take a look. |
Hi @tangjiangling, there have been a couple of PRs taking care of compatibility with the new docker image and the driver. See #3021 and #5474. The default image remains the old one due to backward compatibility (it can change in a major version). Image usage and the driver depends mostly on the usage. So, AFAICT needs are being covered. Thanks for the PR anyway! |
Fixes: #4924