Class InlineArrowResponseProcessor
- java.lang.Object
-
- com.databricks.jdbc.api.impl.streaming.InlineArrowResponseProcessor
-
- All Implemented Interfaces:
ThriftResponseProcessor<ArrowResultChunk>
public class InlineArrowResponseProcessor extends Object implements ThriftResponseProcessor<ArrowResultChunk>
Processes Thrift responses into Arrow chunks.This processor converts
TFetchResultsRespintoArrowResultChunkfor inline Arrow result handling. It caches the Arrow schema from the first response for use in subsequent batches.
-
-
Constructor Summary
Constructors Constructor Description InlineArrowResponseProcessor(StatementId statementId)Creates a new inline Arrow response processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<ArrowResultChunk>getReleaseAction()Creates a release action for the data type.StreamingBatch<ArrowResultChunk>processInitialResponse(TFetchResultsResp response)Processes the initial response and returns batch data.StreamingBatch<ArrowResultChunk>processResponse(TFetchResultsResp response, long batchIndex, long rowOffset)Processes a fetched response and returns batch data.
-
-
-
Constructor Detail
-
InlineArrowResponseProcessor
public InlineArrowResponseProcessor(StatementId statementId)
Creates a new inline Arrow response processor.- Parameters:
statementId- The statement ID for logging and chunk creation
-
-
Method Detail
-
processInitialResponse
public StreamingBatch<ArrowResultChunk> processInitialResponse(TFetchResultsResp response) throws DatabricksSQLException
Description copied from interface:ThriftResponseProcessorProcesses 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.
- Specified by:
processInitialResponsein interfaceThriftResponseProcessor<ArrowResultChunk>- Parameters:
response- The initial Thrift fetch response- Returns:
- A StreamingBatch containing the processed data
- Throws:
DatabricksSQLException- if processing fails
-
processResponse
public StreamingBatch<ArrowResultChunk> processResponse(TFetchResultsResp response, long batchIndex, long rowOffset) throws DatabricksSQLException
Description copied from interface:ThriftResponseProcessorProcesses a fetched response and returns batch data.This method is called for each subsequent batch fetched from the server.
- Specified by:
processResponsein interfaceThriftResponseProcessor<ArrowResultChunk>- Parameters:
response- The Thrift fetch responsebatchIndex- The zero-based batch indexrowOffset- The starting row offset for this batch- Returns:
- A StreamingBatch containing the processed data
- Throws:
DatabricksSQLException- if processing fails
-
getReleaseAction
public Consumer<ArrowResultChunk> getReleaseAction()
Description copied from interface:ThriftResponseProcessorCreates 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.
- Specified by:
getReleaseActionin interfaceThriftResponseProcessor<ArrowResultChunk>- Returns:
- A Consumer that releases the data
-
-