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.
|
SnowflakeResultSetSerializable.ResultSetRetrieveConfig
Constructor and Description |
---|
SnowflakeResultSetSerializableV1()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static SnowflakeResultSetSerializableV1 |
create(com.fasterxml.jackson.databind.JsonNode rootNode,
SFBaseSession sfSession,
SFBaseStatement sfStatement)
A factory function to create SnowflakeResultSetSerializable object from result JSON node, using
the DefaultResultStreamProvider.
|
static SnowflakeResultSetSerializableV1 |
create(com.fasterxml.jackson.databind.JsonNode rootNode,
SFBaseSession sfSession,
SFBaseStatement sfStatement,
ResultStreamProvider resultStreamProvider)
A factory function to create SnowflakeResultSetSerializable object from result JSON node, with
an overrideable ResultStreamProvider.
|
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() |
boolean |
getFormatDateWithTimeZone() |
HttpClientSettingsKey |
getHttpClientKey() |
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()
Deprecated.
Please use new interface function getResultSet(ResultSetRetrieveConfig)
|
ResultSet |
getResultSet(Properties info)
Deprecated.
Please use new interface function getResultSet(ResultSetRetrieveConfig)
|
ResultSet |
getResultSet(SnowflakeResultSetSerializable.ResultSetRetrieveConfig resultSetRetrieveConfig)
Get ResultSet from the ResultSet Serializable object so that the user can access the data.
|
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
ResultStreamProvider |
getResultStreamProvider() |
long |
getResultVersion() |
org.apache.arrow.memory.RootAllocator |
getRootAllocator() |
long |
getRowCount()
Retrieve total row count included in the the ResultSet Serializable object.
|
long |
getSendResultTime() |
Optional<SFBaseSession> |
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 |
getUseSessionTimezone() |
boolean |
isArrayBindSupported() |
boolean |
isHonorClientTZForTimestampNTZ() |
boolean |
isTotalRowCountTruncated() |
void |
setChunkDownloader(ChunkDownloader chunkDownloader) |
void |
setChunkFileCount(int chunkFileCount) |
void |
setFristChunkStringData(String firstChunkStringData) |
void |
setQueryResultFormat(QueryResultFormat queryResultFormat) |
void |
setResultStreamProvider(ResultStreamProvider resultStreamProvider) |
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 void setResultStreamProvider(ResultStreamProvider resultStreamProvider)
public ResultStreamProvider getResultStreamProvider()
public SFResultSetMetaData getSFResultSetMetaData()
public int getResultSetType()
public int getResultSetConcurrency()
public int getResultSetHoldability()
public SnowflakeConnectString getSnowflakeConnectString()
public OCSPMode getOCSPMode()
public HttpClientSettingsKey getHttpClientKey()
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 boolean getFormatDateWithTimeZone()
public boolean getUseSessionTimezone()
public Optional<SFBaseSession> getSession()
public static SnowflakeResultSetSerializableV1 create(com.fasterxml.jackson.databind.JsonNode rootNode, SFBaseSession sfSession, SFBaseStatement sfStatement) throws SnowflakeSQLException
rootNode
- result JSON node received from GSsfSession
- the Snowflake sessionsfStatement
- the Snowflake statementSnowflakeSQLException
- if failed to parse the result JSON nodepublic static SnowflakeResultSetSerializableV1 create(com.fasterxml.jackson.databind.JsonNode rootNode, SFBaseSession sfSession, SFBaseStatement sfStatement, ResultStreamProvider resultStreamProvider) throws SnowflakeSQLException
rootNode
- result JSON node received from GSsfSession
- the Snowflake sessionsfStatement
- the Snowflake statementresultStreamProvider
- a ResultStreamProvider for computing a custom data source for
result-file streamsSnowflakeSQLException
- 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(SnowflakeResultSetSerializable.ResultSetRetrieveConfig resultSetRetrieveConfig) throws SQLException
getResultSet
in interface SnowflakeResultSetSerializable
resultSetRetrieveConfig
- The extra info to retrieve the result set.SQLException
@Deprecated public ResultSet getResultSet() throws SQLException
This API is used by spark spark connector from 2.6.0 to 2.8.1. It is deprecated from sc:2.8.2/jdbc:3.12.12 since Sept 2020. It is safe to remove it after Sept 2022.
getResultSet
in interface SnowflakeResultSetSerializable
SQLException
@Deprecated public ResultSet getResultSet(Properties info) throws SQLException
This API is used by spark spark connector from 2.6.0 to 2.8.1. It is deprecated from sc:2.8.2/jdbc:3.12.12 since Sept 2020. It is safe to remove it after Sept 2022.
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 © 2022. All rights reserved.