Package com.databricks.jdbc.api.impl
Class JsonChunkProvider
- java.lang.Object
-
- com.databricks.jdbc.api.impl.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 Summary
Constructors Constructor Description JsonChunkProvider(ResultManifest resultManifest, ResultData initialResultData, StatementId statementId, IDatabricksSession session)Creates a new JsonChunkProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the provider and releases resources.List<List<Object>>getAllData()Gets the combined data from all chunks.longgetChunkCount()Gets the total number of chunks that were processed.booleanisClosed()Checks if the provider is closed.
-
-
-
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 informationinitialResultData- the first chunk of result datastatementId- the statement ID for fetching additional chunkssession- 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
-
-