class AsyncJob extends AnyRef
Provides a way to track an asynchronous query in Snowflake.
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.
Example 1: Create an AsyncJob by specifying a valid
<query_id>
, check whether
the query is running or not, and get the result rows.
val asyncJob = session.createAsyncJob(<query_id>) println(s"Is query ${asyncJob.getQueryId()} running? ${asyncJob.isRunning()}") val rows = asyncJob.getRows()
Example 2: Create an AsyncJob by specifying a valid
<query_id>
and cancel the query if
it is still running.
session.createAsyncJob(<query_id>).cancel()
- Since
-
0.11.0
- Alphabetic
- By Inheritance
- AsyncJob
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=
(
arg0:
Any
)
:
Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##
()
:
Int
- Definition Classes
- AnyRef → Any
-
final
def
==
(
arg0:
Any
)
:
Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf
[
T0
]
:
T0
- Definition Classes
- Any
-
def
cancel
()
:
Unit
Cancel the underlying query if it is running.
Cancel the underlying query if it is running.
- Since
-
0.11.0
-
def
clone
()
:
AnyRef
- Attributes
- protected[ lang ]
- Definition Classes
- AnyRef
- Annotations
- @throws ( ... ) @native () @HotSpotIntrinsicCandidate ()
-
final
def
eq
(
arg0:
AnyRef
)
:
Boolean
- Definition Classes
- AnyRef
-
def
equals
(
arg0:
Any
)
:
Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass
()
:
Class
[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native () @HotSpotIntrinsicCandidate ()
-
def
getIterator
(
maxWaitTimeInSeconds:
Int
=
session.requestTimeoutInSeconds
)
:
Iterator
[
Row
]
Returns an iterator of Row objects that you can use to retrieve the results for the underlying query.
Returns an iterator of Row objects that you can use to retrieve the results for the underlying query.
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. The default value is the value of the
snowpark_request_timeout_in_seconds
configuration property. - returns
-
An Iterator of Row objects
- Since
-
0.11.0
-
def
getQueryId
()
:
String
Get the query ID for the underlying query.
Get the query ID for the underlying query.
- returns
-
a query ID
- Since
-
0.11.0
-
def
getRows
(
maxWaitTimeInSeconds:
Int
=
session.requestTimeoutInSeconds
)
:
Array
[
Row
]
Returns an Array of Row objects that represent the results of the underlying query.
Returns an Array of Row objects that represent the results of the underlying query.
- maxWaitTimeInSeconds
-
The maximum number of seconds to wait for the query to complete before attempting to retrieve the results. The default value is the value of the
snowpark_request_timeout_in_seconds
configuration property. - returns
-
An Array of Row objects
- Since
-
0.11.0
-
def
hashCode
()
:
Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native () @HotSpotIntrinsicCandidate ()
-
def
isDone
()
:
Boolean
Returns true if the underlying query completed.
Returns true if the underlying query completed.
Completion may be due to query success, cancellation or failure, in all of these cases, this method will return true.
- returns
-
true if this query completed.
- Since
-
0.11.0
-
final
def
isInstanceOf
[
T0
]
:
Boolean
- Definition Classes
- Any
-
final
def
ne
(
arg0:
AnyRef
)
:
Boolean
- Definition Classes
- AnyRef
-
final
def
notify
()
:
Unit
- Definition Classes
- AnyRef
- Annotations
- @native () @HotSpotIntrinsicCandidate ()
-
final
def
notifyAll
()
:
Unit
- Definition Classes
- AnyRef
- Annotations
- @native () @HotSpotIntrinsicCandidate ()
-
final
def
synchronized
[
T0
]
(
arg0: ⇒
T0
)
:
T0
- Definition Classes
- AnyRef
-
def
toString
()
:
String
- Definition Classes
- AnyRef → Any
-
final
def
wait
(
arg0:
Long
,
arg1:
Int
)
:
Unit
- Definition Classes
- AnyRef
- Annotations
- @throws ( ... )
-
final
def
wait
(
arg0:
Long
)
:
Unit
- Definition Classes
- AnyRef
- Annotations
- @throws ( ... ) @native ()
-
final
def
wait
()
:
Unit
- Definition Classes
- AnyRef
- Annotations
- @throws ( ... )
Deprecated Value Members
-
def
finalize
()
:
Unit
- Attributes
- protected[ lang ]
- Definition Classes
- AnyRef
- Annotations
- @throws ( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated