Interface ThriftResponseProcessor<T>

  • Type Parameters:
    T - The type of data produced (ColumnarRowView or ArrowResultChunk)
    All Known Implementing Classes:
    ColumnarResponseProcessor, InlineArrowResponseProcessor

    public interface ThriftResponseProcessor<T>
    Processes a Thrift fetch response into typed result data.

    Implementations handle the conversion of TFetchResultsResp into specific data types (ColumnarRowView for columnar results, ArrowResultChunk for inline Arrow results).

    • Method Detail

      • processInitialResponse

        StreamingBatch<T> processInitialResponse​(TFetchResultsResp response)
                                          throws DatabricksSQLException
        Processes the initial response and returns batch data.

        This method is called once when the streaming provider is created. It may perform additional initialization such as caching schema information.

        Parameters:
        response - The initial Thrift fetch response
        Returns:
        A StreamingBatch containing the processed data
        Throws:
        DatabricksSQLException - if processing fails
      • processResponse

        StreamingBatch<T> processResponse​(TFetchResultsResp response,
                                          long batchIndex,
                                          long rowOffset)
                                   throws DatabricksSQLException
        Processes a fetched response and returns batch data.

        This method is called for each subsequent batch fetched from the server.

        Parameters:
        response - The Thrift fetch response
        batchIndex - The zero-based batch index
        rowOffset - The starting row offset for this batch
        Returns:
        A StreamingBatch containing the processed data
        Throws:
        DatabricksSQLException - if processing fails
      • getReleaseAction

        Consumer<T> getReleaseAction()
        Creates a release action for the data type.

        This action is called when the batch is released from memory. For types that require explicit cleanup (like ArrowResultChunk with native memory), this should perform that cleanup. For types that don't need cleanup (like ColumnarRowView), this can be a no-op.

        Returns:
        A Consumer that releases the data