Package net.snowflake.client.jdbc
Class JsonResultChunk
- java.lang.Object
-
- net.snowflake.client.jdbc.SnowflakeResultChunk
-
- net.snowflake.client.jdbc.JsonResultChunk
-
public class JsonResultChunk extends SnowflakeResultChunk
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk
SnowflakeResultChunk.DownloadState
-
-
Constructor Summary
Constructors Constructor Description JsonResultChunk(String url, int rowCount, int colCount, int uncompressedSize, SFBaseSession session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addByte(byte b, int pos)
void
addBytes(byte[] src, int offset, int pos, int length)
void
addOffset(int offset)
void
addRow(Object[] row)
int
computeCharactersNeeded()
long
computeNeededChunkMemory()
Compute the memory necessary to store the data of this chunkvoid
ensureRowsComplete()
Checks that all data has been added after parsing.static Object
extractCell(com.fasterxml.jackson.databind.JsonNode resultData, int rowIdx, int colIdx)
void
freeData()
byte
get(int offset)
Object
getCell(int rowIdx, int colIdx)
Creates a String object for the given cellvoid
nextIndex()
void
reset()
void
setIsNull()
void
setLastLength(int len)
void
tryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)
-
Methods inherited from class net.snowflake.client.jdbc.SnowflakeResultChunk
getColCount, getDownloadCondition, getDownloadError, getDownloadState, getDownloadTime, getLock, getParseTime, getRowCount, getScrubbedUrl, getUncompressedSize, getUrl, isReleased, setDownloadError, setDownloadState, setDownloadTime, setParseTime, setReleased
-
-
-
-
Constructor Detail
-
JsonResultChunk
public JsonResultChunk(String url, int rowCount, int colCount, int uncompressedSize, SFBaseSession session)
-
-
Method Detail
-
extractCell
public static Object extractCell(com.fasterxml.jackson.databind.JsonNode resultData, int rowIdx, int colIdx)
-
tryReuse
public void tryReuse(net.snowflake.client.jdbc.JsonResultChunk.ResultChunkDataCache cache)
-
getCell
public final Object getCell(int rowIdx, int colIdx)
Creates a String object for the given cell- Parameters:
rowIdx
- zero based rowcolIdx
- zero based column- Returns:
- String
-
addRow
public final void addRow(Object[] row) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
ensureRowsComplete
public final void ensureRowsComplete() throws SnowflakeSQLException
Checks that all data has been added after parsing.- Throws:
SnowflakeSQLException
- when rows are not all downloaded
-
reset
public void reset()
-
computeNeededChunkMemory
public final long computeNeededChunkMemory()
Compute the memory necessary to store the data of this chunk- Returns:
- necessary memory in bytes
-
freeData
public final void freeData()
-
computeCharactersNeeded
public int computeCharactersNeeded()
-
addOffset
public void addOffset(int offset) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
setIsNull
public void setIsNull() throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
setLastLength
public void setLastLength(int len) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
nextIndex
public void nextIndex() throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
get
public byte get(int offset) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
addByte
public void addByte(byte b, int pos) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
addBytes
public void addBytes(byte[] src, int offset, int pos, int length) throws SnowflakeSQLException
- Throws:
SnowflakeSQLException
-
-