数据湖探索 DLI-创建批处理作业:请求示例

时间:2024-04-09 19:13:18

请求示例

创建Spark作业,作业的Spark主类为“org.apache.spark.examples.SparkPi”,指定程序包batchTest/spark-examples_2.11-2.1.0.luxor.jar,并加载上传到DLI类型为jar的程序号和类型为files的资源包。

{
    "file": "batchTest/spark-examples_2.11-2.1.0.luxor.jar",
    "className": "org.apache.spark.examples.SparkPi",
    "sc_type": "A",
    "jars": ["demo-1.0.0.jar"],
    "files": ["count.txt"],
    "resources":[
                   {"name": "groupTest/testJar.jar", "type": "jar"},
                   {"name": "kafka-clients-0.10.0.0.jar", "type": "jar"}],
    "groups": [
                   {"name": "groupTestJar", "resources": [{"name": "testJar.jar", "type": "jar"}, {"name": "testJar1.jar", "type": "jar"}]}, 
                   {"name": "batchTest", "resources":  [{"name": "luxor.jar", "type": "jar"}]}],
    "queue": " test",
    "name": "TestDemo4",
    "feature": "basic",
    "spark_version": "2.3.2"
}

其中“batchTest/spark-examples_2.11-2.1.0.luxor.jar”已提前通过上传分组资源(废弃)接口上传。

support.huaweicloud.com/api-dli/dli_02_0124.html