Class JsonChunkProvider


  • public class JsonChunkProvider
    extends Object
    Chunk provider for JSON_ARRAY format results that handles multiple chunks of data.

    This provider fetches and combines data from multiple JSON chunks when the result is split across multiple chunks. It follows the same pattern as Arrow chunk providers but works with JSON data arrays instead of Arrow streams.

    • Constructor Detail

      • JsonChunkProvider

        public JsonChunkProvider​(ResultManifest resultManifest,
                                 ResultData initialResultData,
                                 StatementId statementId,
                                 IDatabricksSession session)
                          throws DatabricksSQLException
        Creates a new JsonChunkProvider.
        Parameters:
        resultManifest - the result manifest containing chunk information
        initialResultData - the first chunk of result data
        statementId - the statement ID for fetching additional chunks
        session - the session for making API calls
        Throws:
        DatabricksSQLException - if there's an error processing the initial data or fetching chunks
    • Method Detail

      • getAllData

        public List<List<Object>> getAllData()
        Gets the combined data from all chunks.
        Returns:
        the list of all rows from all chunks
      • getChunkCount

        public long getChunkCount()
        Gets the total number of chunks that were processed.
        Returns:
        the chunk count
      • close

        public void close()
        Closes the provider and releases resources.
      • isClosed

        public boolean isClosed()
        Checks if the provider is closed.
        Returns:
        true if closed, false otherwise