class_docstr: Hook for AnalyticDB MySQL Spark through the REST API.
  
  :param adb_spark_conn_id: The Airflow connection used for AnalyticDB MySQL Spark credentials.
  :param region: AnalyticDB MySQL region you want to submit spark application.
class_docstr_tok: ["Hook","for","AnalyticDB","MySQL","Spark","through","the","REST","API",".",":","param","adb_spark_conn_id",":","The","Airflow","connection","used","for","AnalyticDB","MySQL","Spark","credentials",".",":","param","region",":","AnalyticDB","MySQL","region","you","want","to","submit","spark","application","."]
docstr: Build the submit spark sql request data.
  
  :param sql: The SQL query to execute. (templated)
  :param conf: Spark configuration properties.
  :param driver_resource_spec: The resource specifications of the Spark driver.
  :param executor_resource_spec: The resource specifications of each Spark executor.
  :param num_executors: number of executors to launch for this application.
  :param name: name of this application.
docstr_tok: ["Build","the","submit","spark","sql","request","data",".",":","param","sql",":","The","SQL","query","to","execute",".","(","templated",")",":","param","conf",":","Spark","configuration","properties",".",":","param","driver_resource_spec",":","The","resource","specifications","of","the","Spark","driver",".",":","param","executor_resource_spec",":","The","resource","specifications","of","each","Spark","executor",".",":","param","num_executors",":","number","of","executors","to","launch","for","this","application",".",":","param","name",":","name","of","this","application","."]
code: def build_submit_sql_data(
      sql: str | None = None,
      conf: dict[Any, Any] | None = None,
      driver_resource_spec: str | None = None,
      executor_resource_spec: str | None = None,
      num_executors: int | str | None = None,
      name: str | None = None,
  ) -> str:
      """
      Build the submit spark sql request data.
  
      :param sql: The SQL query to execute. (templated)
      :param conf: Spark configuration properties.
      :param driver_resource_spec: The resource specifications of the Spark driver.
      :param executor_resource_spec: The resource specifications of each Spark executor.
      :param num_executors: number of executors to launch for this application.
      :param name: name of this application.
      """
      if sql is None:
          raise ValueError(
              "Parameter sql is need when submit spark sql."
          )
  
      extra_conf: dict[str, str] = {}
      formatted_conf = ""
  
      if driver_resource_spec:
          extra_conf["spark.driver.resourceSpec"] = driver_resource_spec
      if executor_resource_spec:
          extra_conf[
              "spark.executor.resourceSpec"
          ] = executor_resource_spec
      if num_executors:
          extra_conf["spark.executor.instances"] = str(num_executors)
      if name:
          extra_conf["spark.app.name"] = name
      if conf and AnalyticDBSparkHook._validate_extra_conf(conf):
          extra_conf.update(conf)
      for key, value in extra_conf.items():
          formatted_conf += f"set {key} = {value};"
  
      return (formatted_conf + sql).strip()
  
imports: from __future__ import annotations
  import json
  from enum import Enum
  from typing import Any, Sequence
  from alibabacloud_adb20211201.client import Client
  from alibabacloud_adb20211201.models import GetSparkAppLogRequest, GetSparkAppStateRequest, GetSparkAppWebUiAddressRequest, KillSparkAppRequest, SubmitSparkAppRequest, SubmitSparkAppResponse
  from alibabacloud_tea_openapi.models import Config
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 9 for calling the AnalyticDBSparkHook obj's underlying member method code with example usage: obj.build_submit_sql_data(sql, conf, driver_resource_spec, executor_resource_spec, num_executors, name) and returns: unknown