全部產品
Search
文件中心

AnalyticDB:SubmitSparkApp - 提交Spark應用

更新時間:Mar 17, 2026

提交Spark應用。

介面說明

  • 地區的公網接入地址:adb.<region-id>.aliyuncs.com。樣本:adb.cn-hangzhou.aliyuncs.com

  • 地區的 VPC 接入地址:adb-vpc.<region-id>.aliyuncs.com。樣本:adb-vpc.cn-hangzhou.aliyuncs.com

說明

如果華北 1(青島)、華南 1(深圳)、華南 3(廣州)、中國香港發起請求時,遇到 409 錯誤,請聯絡支援人員。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

adb:SubmitSparkApp

create

*SparkApplication

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}/resourcegroup/{#ResourceGroup}

請求參數

名稱

類型

必填

描述

樣本值

AppName

string

應用程式名稱,可自訂字串,長度不能超過 64 個字元。

TestApp

AppType

string

應用類型,取值說明:

  • SQL:SQL 應用。

  • STREAMING:流應用。

  • BATCH(預設值):離線應用。

SQL

Data

string

應用模板資料。

說明

應用模板配置,請參見《Spark 應用配置指南》

conf spark.driver.resourceSpec=small; conf spark.executor.instances=1; conf spark.executor.resourceSpec=small; conf spark.app.name=TestApp;

AgentSource

string

用戶端類型。可自訂字串,長度不能超過 64 個字元。

CONSOLE

AgentVersion

string

應用程式使用的版本。可自訂字串,長度不能超過 64 個字元。

1.091

DBClusterId

string

企業版、基礎版或湖倉版叢集 ID。

說明

您可以調用 DescribeDBClusters 介面可以查詢叢集 ID。

amv-bp11q28kvl688****

ResourceGroupName

string

Job 型資源群組名稱。

說明

您可以調用 DescribeDBResourceGroup 介面查看叢集的資源群組 ID。

adb

TemplateFileId

integer

應用模板 ID。

說明

您可以調用 GetSparkTemplateFullTree 介面可以查詢應用模板 ID。

15

返回參數

名稱

類型

描述

樣本值

object

工作清單。

RequestId

string

請求 ID。

1AD222E9-E606-4A42-BF6D-8A4442913CEF

Data

object

資料列表。

AppId

string

應用 ID。

s202204132018hzprec1ac61a000****

AppName

string

應用程式名稱。

TestApp

Message

string

返回警示資訊,如任務執行失敗或資源不足等,無警示時則返回為空白。

Insufficient resources.

State

string

應用執行狀態,取值說明:

  • SUBMITTED:已提交。

  • STARTING:開始啟動。

  • RUNNING:執行中。

  • FAILING:任務失敗,清理環境中。

  • FAILED:失敗。

  • KILLING:中止任務,清理環境中。

  • KILLED:中止任務。

  • SUCCEEDING:任務執行結束,清理環境中。

  • COMPLETED:任務執行結束。

  • FATAL:意外失敗。

  • UNKNOWN:未知錯誤。

SUBMITTED

樣本

正常返回樣本

JSON格式

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "Data": {
    "AppId": "s202204132018hzprec1ac61a000****",
    "AppName": "TestApp",
    "Message": "Insufficient resources.",
    "State": "SUBMITTED"
  }
}

錯誤碼

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失敗。
400 Spark.RoleARN.invalid Current account fails to verify the permissions of the RAM system, please check the help information and configure the appropriate permissions for the current account. 請確保您當前的 RAM 使用者 (ram_user_id %s) 已被授予系統策略“AliyunADBDeveloperAccess”。然後按照“在阿里雲帳戶內執行授權”部分進行作。這將自動初始化您的雲帳戶中名為“aliyunadbsparkprocessingdatarole”的系統角色。更多詳細資料:https://www.alibabacloud.com/help/en/analyticdb/analyticdb-for-mysql/user-guide/create-the-aliyunadbsparkprocessingdatarole-role-for-a-ram-user-and-grant-permissions-to-the-role
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。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情