public class StmtUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StmtUtil.StmtOutput
Output for running a statement on server
|
Constructor and Description |
---|
StmtUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cancel(net.snowflake.client.core.StmtUtil.StmtInput stmtInput)
Cancel a statement identifiable by a request id
|
static SFStatementType |
checkStageManageCommand(String sql)
A simple function to check if the statement is related to manipulate stage.
|
static StmtUtil.StmtOutput |
execute(net.snowflake.client.core.StmtUtil.StmtInput stmtInput)
Execute a statement
|
protected static String |
getQueryResult(com.fasterxml.jackson.databind.JsonNode inProgressResponse,
String previousGetResultPath,
net.snowflake.client.core.StmtUtil.StmtInput stmtInput)
Issue get-result call to get query result given an in-progress response.
|
protected static String |
getQueryResult(String getResultPath,
net.snowflake.client.core.StmtUtil.StmtInput stmtInput)
Issue get-result call to get query result given an in-progress response.
|
protected static com.fasterxml.jackson.databind.JsonNode |
getQueryResultJSON(String queryId,
SFSession session)
Issue get-result call to get query result given an in progress response.
|
static String |
truncateSQL(String sql)
Truncate a SQL text for logging
|
public static StmtUtil.StmtOutput execute(net.snowflake.client.core.StmtUtil.StmtInput stmtInput) throws SFException, SnowflakeSQLException
side effect: stmtInput.prevGetResultURL is set if we have started ping pong and receives an exception from session token expiration so that during retry we don't retry the query submission, but continue the ping pong process.
stmtInput
- input statementSFException
- exception raised from Snowflake componentsSnowflakeSQLException
- exception raised from Snowflake componentsprotected static String getQueryResult(com.fasterxml.jackson.databind.JsonNode inProgressResponse, String previousGetResultPath, net.snowflake.client.core.StmtUtil.StmtInput stmtInput) throws SFException, SnowflakeSQLException
inProgressResponse
- In progress response in JSON formpreviousGetResultPath
- previous get results pathstmtInput
- input statementSFException
- exception raised from Snowflake componentsSnowflakeSQLException
- exception raised from Snowflake componentsprotected static String getQueryResult(String getResultPath, net.snowflake.client.core.StmtUtil.StmtInput stmtInput) throws SFException, SnowflakeSQLException
getResultPath
- path to resultsstmtInput
- object with context informationSFException
- exception raised from Snowflake componentsSnowflakeSQLException
- exception raised from Snowflake componentsprotected static com.fasterxml.jackson.databind.JsonNode getQueryResultJSON(String queryId, SFSession session) throws SFException, SnowflakeSQLException
queryId
- id of query to get results forsession
- the current sessionSFException
- exception raised from Snowflake componentsSnowflakeSQLException
- exception raised from Snowflake componentspublic static void cancel(net.snowflake.client.core.StmtUtil.StmtInput stmtInput) throws SFException, SnowflakeSQLException
stmtInput
- input statementSFException
- if there is an internal exceptionSnowflakeSQLException
- if failed to cancel the statementpublic static SFStatementType checkStageManageCommand(String sql)
sql
- a SQL statement/commandCopyright © 2020. All rights reserved.