Retrieves the execution results of an SQL statement.
Try it now
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
emr-serverless-spark:ListSqlStatementContents | none | *All Resource
| None | None |
Request syntax
GET /api/v1/workspaces/{workspaceId}/action/listSqlStatementContents HTTP/1.1Request parameters
Parameter | Type | Required | Description | Example |
fileName | string | No | The full path of the file. | oss://oss-****.cn-hangzhou.oss-dls.aliyuncs.com/w-86a9a4da*****a1/spark/logs/jr-b737b****6164d/driver/st-afde7******bb3f |
workspaceId | string | No | The workspace ID. | w-72704d9fb0****** |
nextToken | string | No | The token that specifies the position from which to start reading the results. | 1 |
maxResults | integer | No | The maximum number of records to return for a single request. | 2000 |
Response elements
Element | Type | Description | Example |
object | The data returned. | ||
| sqlStatementContents | object | The content of the SQL execution result. | |
contents | string | A list of the SQL execution results. | [{\"values\":[\"wj*****\",\"test\",\"2025-04-15\"]}] |
nextToken | string | The token that specifies the position from which to start reading the results. | 1 |
maxResults | integer | The maximum number of records returned for a single request. | 2000 |
totalCount | integer | The total number of rows in the result. | 40000 |
requestId | string | The request ID. | DD6B1B2A-5837-5237-ABE4-FF0C8944**** |
Examples
Success response
JSON format
{
"sqlStatementContents": {
"contents": "[{\\\"values\\\":[\\\"wj*****\\\",\\\"test\\\",\\\"2025-04-15\\\"]}]",
"nextToken": "1",
"maxResults": 2000,
"totalCount": 40000
},
"requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****\n"
}Error codes
See for a complete list.
Release notes
See 变更详情 for a complete list.