-
Notifications
You must be signed in to change notification settings - Fork 546
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
[BUG] - jdbc driver throw exception when count() is used with JSONEachRow #726
Comments
Similar issue as #725. For text format without header, we should use something like |
@zhicwu Thanks for the quick reply. May i know the date the next release is scheduled for ? |
I'm aiming a release in early Oct, during holidays in China :) |
The PR is a brand new Java client along with implementation built on top of gRPC. It's related but not really a "fix" to the issue. I still need some more time to apply the changes to JDBC driver. In case you want to try the experimental staff on develop branch:
ClickHouseNode server = ClickHouseNode.of("localhost", ClickHouseProtocol.GRPC, 9100, "tutorial");
// important to close both client and response if you won't reuse them later
try (ClickHouseClient client = ClickHouseClient.newInstance(server.getProtocol());
ClickHouseResponse resp = client.connect(server).format(ClickHouseFormat.JSONEachRow)
.query("select count() from visits_v1").execute().get()) {
for (ClickHouseRecord r : resp.records()) {
System.out.println(r.getValue(0).asLong());
}
// or simply:
// System.out.println(resp.firstRecord().getValue(0).asLong());
} |
In addition to Java client, it works in new JDBC driver as well. select count() from system.query_log format JSONEachRow
--
results
{"count()":"6768"}
select count() from system.query_log format Markdown
--
results
| count() |
|-:|
| 6772 | |
Valid SQL statement with clickhouse-client:
Snippet:
throws:
The text was updated successfully, but these errors were encountered: