You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After executing an SQL query, attempting to retrieve ServerMetrics.ELAPSED_TIME or ServerMetrics.RESULT_ROWS from OperationMetrics results in a NullPointerException. This error indicates that metrics.getMetric() is returning null, likely because the OperationMetrics instance did not record the relevant metrics correctly.
Steps to reproduce
Configure the ClickHouse client and run the following code.
Call the executeSQL method, passing in an SQL query and queryId.
Observe the logs to see if the error message appears: Cannot invoke "com.clickhouse.client.api.metrics.Metric.getLong()" because the return value of "com.clickhouse.client.api.metrics.OperationMetrics.getMetric(com.clickhouse.client.api.metrics.ServerMetrics)" is null.
Cannot invoke "com.clickhouse.client.api.metrics.Metric.getLong()" because the return value of "com.clickhouse.client.api.metrics.OperationMetrics.getMetric(com.clickhouse.client.api.metrics.ServerMetrics)" is null
I also encountered this issue, here is the screenshot。
It seems that the [ELAPSED_TIME("server.elapsedTime");] value was not returned. maybe the elapsedTime value needs to be parsed from the [client.opDuration] section? @chernser
Describe the bug
After executing an SQL query, attempting to retrieve ServerMetrics.ELAPSED_TIME or ServerMetrics.RESULT_ROWS from OperationMetrics results in a NullPointerException. This error indicates that metrics.getMetric() is returning null, likely because the OperationMetrics instance did not record the relevant metrics correctly.
Steps to reproduce
Expected behaviour
Code example
Error log
Cannot invoke "com.clickhouse.client.api.metrics.Metric.getLong()" because the return value of "com.clickhouse.client.api.metrics.OperationMetrics.getMetric(com.clickhouse.client.api.metrics.ServerMetrics)" is null
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: