Package com.clickhouse.client.api.query
Class QueryResponse
java.lang.Object
com.clickhouse.client.api.query.QueryResponse
- All Implemented Interfaces:
AutoCloseable
Response class provides interface to input stream of response data.
It is used to read data from ClickHouse server. It is used to get response metadata like errors, warnings, etc.
It is used to read data from ClickHouse server. It is used to get response metadata like errors, warnings, etc.
This class is for the following user cases:
- Full read. User does conversion from record to custom object
- Full read. No conversion to custom object. List of generic records is returned.
- Iterative read. One record is returned at a time
-
Constructor Summary
ConstructorsConstructorDescriptionQueryResponse(org.apache.hc.core5.http.ClassicHttpResponse response, ClickHouseFormat format, QuerySettings settings, OperationMetrics operationMetrics) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the metrics of this operation.Alias forOperationMetrics.getQueryId()longAlias forServerMetrics.NUM_BYTES_READlongAlias forServerMetrics.NUM_ROWS_READlongAlias forServerMetrics.RESULT_ROWSlongAlias forServerMetrics.ELAPSED_TIMElongAlias forServerMetrics.TOTAL_ROWS_TO_READlongAlias forServerMetrics.NUM_BYTES_WRITTENlongAlias forServerMetrics.NUM_ROWS_WRITTEN
-
Constructor Details
-
QueryResponse
public QueryResponse(org.apache.hc.core5.http.ClassicHttpResponse response, ClickHouseFormat format, QuerySettings settings, OperationMetrics operationMetrics)
-
-
Method Details
-
getInputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getFormat
-
getMetrics
Returns the metrics of this operation.- Returns:
- metrics of this operation
-
getReadRows
public long getReadRows()Alias forServerMetrics.NUM_ROWS_READ- Returns:
- number of rows read by server from the storage
-
getReadBytes
public long getReadBytes()Alias forServerMetrics.NUM_BYTES_READ- Returns:
- number of bytes read by server from the storage
-
getWrittenRows
public long getWrittenRows()Alias forServerMetrics.NUM_ROWS_WRITTEN- Returns:
- number of rows written by server to the storage
-
getWrittenBytes
public long getWrittenBytes()Alias forServerMetrics.NUM_BYTES_WRITTEN- Returns:
- number of bytes written by server to the storage
-
getServerTime
public long getServerTime()Alias forServerMetrics.ELAPSED_TIME- Returns:
- elapsed time in nanoseconds
-
getResultRows
public long getResultRows()Alias forServerMetrics.RESULT_ROWS- Returns:
- number of returned rows
-
getTotalRowsToRead
public long getTotalRowsToRead()Alias forServerMetrics.TOTAL_ROWS_TO_READ- Returns:
- estimated number of rows to read
-
getQueryId
Alias forOperationMetrics.getQueryId()- Returns:
- query id of the request
-
getTimeZone
-
getSettings
-