Interface ClickHouseResponse

    • Field Detail

    • Method Detail

      • getColumns

        List<ClickHouseColumn> getColumns()
        Gets list of columns.
        Returns:
        non-null list of column
      • getSummary

        ClickHouseResponseSummary getSummary()
        Gets summary of this response. Keep in mind that the summary may change over time until response is closed.
        Returns:
        non-null summary of this response
      • getInputStream

        ClickHouseInputStream getInputStream()
        Gets input stream of the response. In general, this is the most memory-efficient way for streaming data from server to client. However, this also means additional work is required for deserialization, especially when using a binary format.
        Returns:
        input stream for getting raw data returned from server
      • records

        Iterable<ClickHouseRecord> records()
        Returns an iterable collection of records which can be walked through in a foreach loop. Please pay attention that: 1) UncheckedIOException might be thrown when iterating through the collection; and 2) it's not supposed to be called for more than once.
        Returns:
        non-null iterable collection
        Throws:
        UncheckedIOException - when failed to read data(e.g. deserialization)
      • pipe

        default void pipe​(OutputStream output,
                          int bufferSize)
                   throws IOException
        Pipes the contents of this response into the given output stream. Keep in mind that it's caller's responsibility to flush and close the output stream.
        Parameters:
        output - non-null output stream, which will remain open
        bufferSize - buffer size, 0 or negative value will be treated as ClickHouseClientOption.BUFFER_SIZE
        Throws:
        IOException - when error occurred reading or writing data
      • stream

        default Stream<ClickHouseRecord> stream()
        Gets stream of records to process.
        Returns:
        stream of records
      • isClosed

        boolean isClosed()
        Checks whether the reponse has been closed or not.
        Returns:
        true if the response has been closed; false otherwise