public class AsyncJob extends Object
You can use this object to check the status of an asynchronous query and retrieve the results.
To check the status of an asynchronous query that you submitted earlier, call Session.createAsyncJob, and pass in the query ID. This returns an `AsyncJob` object that you can
use to check the status of the query and retrieve the query results.
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancel the underlying query if it is running.
|
Iterator<Row> |
getIterator()
Returns an iterator of Row objects that you can use to retrieve the results for the underlying
query.
|
Iterator<Row> |
getIterator(int maxWaitTimeInSeconds)
Returns an iterator of Row objects that you can use to retrieve the results for the underlying
query.
|
String |
getQueryId()
Get the query ID for the underlying query.
|
Row[] |
getRows()
Returns an Array of Row objects that represent the results of the underlying query.
|
Row[] |
getRows(int maxWaitTimeInSeconds)
Returns an Array of Row objects that represent the results of the underlying query.
|
boolean |
isDone()
Returns true if the underlying query completed.
|
public String getQueryId()
public Iterator<Row> getIterator(int maxWaitTimeInSeconds)
Unlike the getRows method, this method does not load all data into memory at once.
maxWaitTimeInSeconds - The maximum number of seconds to wait for the query to complete
before attempting to retrieve the results.public Iterator<Row> getIterator()
Unlike the getRows method, this method does not load all data into memory at once.
The max waiting time is the value of `snowpark_request_timeout_in_seconds` configuration property.
public Row[] getRows(int maxWaitTimeInSeconds)
maxWaitTimeInSeconds - The maximum number of seconds to wait for the query to complete
before attempting to retrieve the results.public Row[] getRows()
The max waiting time is the value of the `snowpark_request_timeout_in_seconds` configuration property.
public boolean isDone()
Completion may be due to query success, cancellation or failure, in all of these cases, this method will return true.
public void cancel()
© 2022 Snowflake Inc. All Rights Reserved