public class SnowflakeResultSetSerializableV1 extends Object implements SnowflakeResultSetSerializable, Serializable
A typical result JSON data section consists of the content of the first chunk file and file metadata for the rest of chunk files e.g. URL, chunk size, etc. So this object consists of one chunk data and a list of chunk file entries. In actual cases, it may only include chunk data or chunk files entries.
This object is serializable, so it can be distributed to other threads or worker nodes for distributed processing.
Modifier and Type | Class and Description |
---|---|
static class |
SnowflakeResultSetSerializableV1.ChunkFileMetadata
An Entity class to represent a chunk file metadata.
|
Constructor and Description |
---|
SnowflakeResultSetSerializableV1()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static SnowflakeResultSetSerializableV1 |
create(com.fasterxml.jackson.databind.JsonNode rootNode,
SFSession sfSession,
SFStatement sfStatement)
A factory function to create SnowflakeResultSetSerializable object from result JSON node.
|
com.fasterxml.jackson.databind.JsonNode |
getAndClearFirstChunkRowset() |
net.snowflake.common.core.SFBinaryFormat |
getBinaryFormatter() |
ChunkDownloader |
getChunkDownloader() |
int |
getChunkFileCount() |
List<SnowflakeResultSetSerializableV1.ChunkFileMetadata> |
getChunkFileMetadatas() |
Map<String,String> |
getChunkHeadersMap() |
int |
getColumnCount() |
long |
getCompressedDataSizeInBytes()
Retrieve compressed data size in the the ResultSet Serializable object.
|
net.snowflake.common.core.SnowflakeDateTimeFormat |
getDateFormatter() |
String |
getFinalDatabaseName() |
String |
getFinalRoleName() |
String |
getFinalSchemaName() |
String |
getFinalWarehouseName() |
int |
getFirstChunkRowCount() |
String |
getFirstChunkStringData() |
long |
getMemoryLimit() |
List<MetaDataOfBinds> |
getMetaDataOfBinds() |
int |
getNetworkTimeoutInMilli() |
int |
getNumberOfBinds() |
OCSPMode |
getOCSPMode() |
Map<String,Object> |
getParameters() |
String |
getQrmk() |
String |
getQueryId() |
QueryResultFormat |
getQueryResultFormat() |
List<SnowflakeColumnMetadata> |
getResultColumnMetadata() |
int |
getResultPrefetchThreads() |
ResultSet |
getResultSet()
Get ResultSet from the ResultSet Serializable object so that the user can access the data.
|
ResultSet |
getResultSet(Properties info)
Get ResultSet from the ResultSet Serializable object so that the user can access the data.
|
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
long |
getResultVersion() |
org.apache.arrow.memory.RootAllocator |
getRootAllocator() |
long |
getRowCount()
Retrieve total row count included in the the ResultSet Serializable object.
|
long |
getSendResultTime() |
Optional<SFSession> |
getSession() |
SFResultSetMetaData |
getSFResultSetMetaData() |
SnowflakeConnectString |
getSnowflakeConnectString() |
SFStatementType |
getStatementType() |
net.snowflake.common.core.SnowflakeDateTimeFormat |
getTimeFormatter() |
net.snowflake.common.core.SnowflakeDateTimeFormat |
getTimestampLTZFormatter() |
net.snowflake.common.core.SnowflakeDateTimeFormat |
getTimestampNTZFormatter() |
net.snowflake.common.core.SnowflakeDateTimeFormat |
getTimestampTZFormatter() |
TimeZone |
getTimeZone() |
boolean |
getTreatNTZAsUTC() |
long |
getUncompressedDataSizeInBytes()
Retrieve Uncompressed data size in the the ResultSet Serializable object.
|
boolean |
isArrayBindSupported() |
boolean |
isHonorClientTZForTimestampNTZ() |
boolean |
isTotalRowCountTruncated() |
void |
setChunkDownloader(ChunkDownloader chunkDownloader) |
void |
setChunkFileCount(int chunkFileCount) |
void |
setFristChunkStringData(String firstChunkStringData) |
void |
setQueryResultFormat(QueryResultFormat queryResultFormat) |
void |
setRootAllocator(org.apache.arrow.memory.RootAllocator rootAllocator) |
List<SnowflakeResultSetSerializable> |
splitBySize(long maxSizeInBytes)
Split this object into small pieces based on the user specified data size.
|
String |
toString() |
public SnowflakeResultSetSerializableV1()
public void setRootAllocator(org.apache.arrow.memory.RootAllocator rootAllocator)
public void setQueryResultFormat(QueryResultFormat queryResultFormat)
public void setChunkFileCount(int chunkFileCount)
public void setFristChunkStringData(String firstChunkStringData)
public void setChunkDownloader(ChunkDownloader chunkDownloader)
public SFResultSetMetaData getSFResultSetMetaData()
public int getResultSetType()
public int getResultSetConcurrency()
public int getResultSetHoldability()
public SnowflakeConnectString getSnowflakeConnectString()
public OCSPMode getOCSPMode()
public String getQrmk()
public int getNetworkTimeoutInMilli()
public int getResultPrefetchThreads()
public long getMemoryLimit()
public List<SnowflakeResultSetSerializableV1.ChunkFileMetadata> getChunkFileMetadatas()
public org.apache.arrow.memory.RootAllocator getRootAllocator()
public QueryResultFormat getQueryResultFormat()
public int getChunkFileCount()
public boolean isArrayBindSupported()
public String getQueryId()
public String getFinalDatabaseName()
public String getFinalSchemaName()
public String getFinalRoleName()
public String getFinalWarehouseName()
public SFStatementType getStatementType()
public boolean isTotalRowCountTruncated()
public int getColumnCount()
public List<SnowflakeColumnMetadata> getResultColumnMetadata()
public com.fasterxml.jackson.databind.JsonNode getAndClearFirstChunkRowset()
public int getFirstChunkRowCount()
public long getResultVersion()
public int getNumberOfBinds()
public ChunkDownloader getChunkDownloader()
public net.snowflake.common.core.SnowflakeDateTimeFormat getTimestampNTZFormatter()
public net.snowflake.common.core.SnowflakeDateTimeFormat getTimestampLTZFormatter()
public net.snowflake.common.core.SnowflakeDateTimeFormat getTimestampTZFormatter()
public net.snowflake.common.core.SnowflakeDateTimeFormat getDateFormatter()
public net.snowflake.common.core.SnowflakeDateTimeFormat getTimeFormatter()
public TimeZone getTimeZone()
public boolean isHonorClientTZForTimestampNTZ()
public net.snowflake.common.core.SFBinaryFormat getBinaryFormatter()
public long getSendResultTime()
public List<MetaDataOfBinds> getMetaDataOfBinds()
public String getFirstChunkStringData()
public boolean getTreatNTZAsUTC()
public static SnowflakeResultSetSerializableV1 create(com.fasterxml.jackson.databind.JsonNode rootNode, SFSession sfSession, SFStatement sfStatement) throws SnowflakeSQLException
rootNode
- result JSON node received from GSsfSession
- the Snowflake sessionsfStatement
- the Snowflake statementSnowflakeSQLException
- if failed to parse the result JSON nodepublic List<SnowflakeResultSetSerializable> splitBySize(long maxSizeInBytes) throws SQLException
maxSizeInBytes
- the expected max data size wrapped in the result ResultSetSerializables
object. NOTE: if a result chunk size is greater than this value, the ResultSetSerializable
object will include one result chunk.SQLException
- if fails to split objects.public ResultSet getResultSet() throws SQLException
getResultSet
in interface SnowflakeResultSetSerializable
SQLException
public ResultSet getResultSet(Properties info) throws SQLException
getResultSet
in interface SnowflakeResultSetSerializable
info
- The proxy sever information if proxy is necessary.SQLException
public long getRowCount() throws SQLException
GS sends the data of first chunk and metadata of the other chunk if exist to client, so this function calculates the row count for all of them.
getRowCount
in interface SnowflakeResultSetSerializable
SQLException
public long getCompressedDataSizeInBytes() throws SQLException
GS sends the data of first chunk and metadata of the other chunks if exist to client, so this function calculates the data size for all of them. NOTE: if first chunk exists, this function uses its uncompressed data size as its compressed data size in this calculation though it is not compressed.
getCompressedDataSizeInBytes
in interface SnowflakeResultSetSerializable
SQLException
public long getUncompressedDataSizeInBytes() throws SQLException
GS sends the data of first chunk and metadata of the other chunk if exist to client, so this function calculates the data size for all of them.
getUncompressedDataSizeInBytes
in interface SnowflakeResultSetSerializable
SQLException
Copyright © 2020. All rights reserved.