GetSparkReplStatement - 获取一段代码的执行结果
获取一段代码的执行结果。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
adb:GetSparkReplStatement |
none |
*DBClusterLakeVersion
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| AppId |
string |
否 |
应用 ID。 说明
可调用 ListSparkApps 接口查询 Spark 应用 ID。 |
s202411071444hzdvk486d9d200**** |
| StatementId |
integer |
否 |
Spark 作业中代码块的唯一 ID。 |
123 |
| SessionId |
integer |
否 |
执行代码的会话 ID。 |
1 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
1AD222E9-E606-4A42-BF6D-8A4442913CEF |
| Data |
object |
返回数据。 |
|
| StatementId |
integer |
此 Spark 作业中代码块的唯一 ID |
123 |
| Code |
string |
执行的代码。 |
print(1+1) |
| CodeType |
string |
代码的类型,取值如下:
|
PYTHON |
| CodeState |
string |
代码执行状态,取值如下:
|
RUNNING |
| AliyunUid |
integer |
实例所属的阿里云账户 ID。 |
144740799645**** |
| OutputType |
string |
输出结果的类型。 枚举值:
|
TEXT |
| Output |
string |
输出结果,一个 JSON 格式的 STRING。 |
{"text/plain": 2} |
| Columns |
array |
列名数组。 |
|
|
string |
列名。 |
col1 |
|
| Error |
string |
错误消息。 |
stackoverflow error |
| StartTime |
integer |
任务开始时间,Unix 时间戳,单位毫秒。 |
1730968194000 |
| EndTime |
integer |
任务结束时间,Unix 时间戳,单位毫秒。 |
1730968194000 |
示例
正常返回示例
JSON格式
{
"RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
"Data": {
"StatementId": 123,
"Code": "print(1+1)",
"CodeType": "PYTHON",
"CodeState": "RUNNING",
"AliyunUid": 0,
"OutputType": "TEXT",
"Output": "{\"text/plain\": 2}",
"Columns": [
"col1"
],
"Error": "stackoverflow error",
"StartTime": 1730968194000,
"EndTime": 1730968194000
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Spark.App.ExceedQuotaLimitation | The requested resource exceeds the maximum limit: %s | |
| 400 | Spark.App.InvalidAppTypeWhenSubmit | The specified AppType is INVALID or NULL. Please refer to the documentation to correct the parameters for %s. | AppType类型不合法,请参考使用文档指定适合业务的AppType,请关注配置类型:%s。 |
| 400 | Spark.App.InvalidResourceSpec | The requested resource type is not supported:\n %s | |
| 400 | Spark.App.ParameterConflict | Conflicting parameters submitted:\n %s | |
| 400 | Spark.App.ResourceNegativeError | The requested resource MUST be positive: %s | |
| 400 | Spark.Config.InvalidAppFilePath | The main driver file MUST be a valid OSS path. Current is %s. | 主驱动文件地址必须是合法的OSS地址,当前的地址是 %s。 |
| 400 | Spark.Config.invalidConnectors | The spark.adb.connectors configuration is invalid: %s | spark.adb.connectors配置不正确。 |
| 400 | Spark.Config.InvalidDiskConfig | The requested disk mount parameter is invalid: %s | 磁盘挂载配置错误。 |
| 400 | Spark.Config.InvalidHostAliasConfig | The requested host alias parameter %s is invalid. Example: 127.0.0.1 localhost local | 域名映射配置错误。 |
| 400 | Spark.Config.InvalidLogOssPath | The OSS address for log storage is illegal: %s | 存储日志的OSS地址非法。 |
| 400 | Spark.Config.InvalidRoleArnFormat | Configure RoleARN %s invalid format. It should match acs:ram::uid_number:role/role_name | 配置的RoleARN格式错误。 |
| 400 | Spark.Config.InvalidTimeZone | Unable to parse time zone configuration %s : %s | 时区配置错误。 |
| 400 | Spark.Config.MainAppFileNotExists | The main driver file is missing, [file] or [sqls] must be configured. | 主驱动文件缺失,必须保证file或者sqls配置不为空。 |
| 400 | Spark.Config.OSSPathAccessError | The configured OSS address %s cannot be accessed. | 配置的OSS路径无法访问。 |
| 400 | Spark.Config.OSSPathNotExists | The OSS address %s requested does not exist or the permissions are insufficient. | OSS路径不存在或当前用户无权限访问。 |
| 400 | Spark.Config.RoleArnVerifyFailed | RoleARN parameter verification failed. Error msg: %s when verify RoleArn %s | RoleARN参数校验失败。 |
| 400 | Spark.Config.SecurityGroupNotFound | The security group in the configuration does not exist or cannot be accessed. %s. | 配置的资源组不存在或者因权限不足无法访问。%s。 |
| 400 | Spark.Config.VswitchNotFound | The vswitch in the configuration does not exist or cannot be accessed. %s. | 无法找到配置虚拟机交换机,或当前账号权限不足。%s。 |
| 400 | Spark.InvalidParameter | Invalid parameter value: %s | 输入参数不正确:%s。 |
| 400 | Spark.InvalidState | The object of the operation is in an invalid state: %s | 操作对象处于非合法状态。 |
| 400 | Spark.RoleArn.Invalid | %s is not found, or the RAM role has not been authorized. | RoleArn不存在或子账号未授权。 |
| 400 | Spark.SQL.BlankError | Input sql can not be blank string. | 提交SQL不能为空。 |
| 400 | Spark.SQL.MultipleSQLError | Element in field [sqls] can not contain more than one sql statement: %s. | 提交的Spark SQL包含了多条可执行SQL。 |
| 400 | Spark.SQL.NotFoundExecutableSQLError | No executable statements are submitted. Please check the input SQL. | Spark作业的SQL信息中不包含可执行语句。 |
| 400 | Spark.SQL.ParserError | Submit spark app failed when parser SQL %s. Error message: %s. | 解析提交的Spark SQL失败。 |
| 500 | Spark.ServerError | The Spark control component system encountered an error, please create a ticket to solve the problem or concat the supported engineer on duty. Error message: %s | Spark管控组件系统遇到错误,请提交工单,或联系值班工程师。 |
| 403 | Spark.Forbidden | No permissions to access the resources: %s | 权限不足,拒绝访问相关资源。您当前申请访问的信息是:%s。 |
| 404 | Spark.App.ContentNotFound | The requested content %s of the Spark application is not found. | 找不到指定Spark作业的提交内容。 |
| 404 | Spark.App.NotFound | The Spark application %s is not found. | 未能找到输入的 Spark App。 |
| 404 | Spark.ObjectNotFound | The object is not found. More information: %s | 操作对象不存在。关联信息:%s。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。