Share via


Spark Session - Get Spark Statement

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

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

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 集區的名稱。

statementId
path True

integer

int32

語句的標識碼。

回應

名稱 類型 Description
200 OK

SparkStatement

Success

範例

Gets a single statement within a spark session.

Sample Request

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

Sample Response

{
  "id": 123,
  "code": "fill in here",
  "state": "fill in here",
  "output": null
}

定義

名稱 Description
LivyStatementStates
SparkStatement
SparkStatementOutput

LivyStatementStates

名稱 類型 Description
available

string

cancelled

string

cancelling

string

error

string

running

string

waiting

string

SparkStatement

名稱 類型 Description
code

string

id

integer

output

SparkStatementOutput

state

LivyStatementStates

SparkStatementOutput

名稱 類型 Description
data

object

ename

string

evalue

string

execution_count

integer

status

string

traceback

string[]