Spark Session - Get Spark Statements

取得Spark會話內的語句清單。

GET {endpoint}/livyApi/versions/{livyApiVersion}/sparkPools/{sparkPoolName}/sessions/{sessionId}/statements

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string

工作區開發端點,例如 https://myworkspace.dev.azuresynapse.net。

livyApiVersion
path True

string

要求的有效 API 版本。

sessionId
path True

integer (int32)

會話的標識碼。

sparkPoolName
path True

string

Spark 集區的名稱。

回覆

名稱 類型 Description
200 OK

SparkStatementCollection

成功

範例

Gets a list of statements within a spark session.

範例要求

GET myWorkspace.dev.azuresynapse.net/livyApi/versions/2020-12-01/sparkPools/mySparkPool/sessions/123/statements

範例回覆

{
  "total_statements": 2,
  "statements": []
}

定義

名稱 Description
LivyStatementStates
SparkStatement
SparkStatementCollection
SparkStatementOutput

LivyStatementStates

值 Description
waiting
running
available
error
cancelling
cancelled

SparkStatement

名稱 類型 Description
code

string

id

integer (int32)

output

SparkStatementOutput

state

LivyStatementStates

SparkStatementCollection

名稱 類型 Description
statements

SparkStatement[]

total_statements

integer (int32)

SparkStatementOutput

名稱 類型 Description
data

object

ename

string

evalue

string

execution_count

integer (int32)

status

string

traceback

string[]