Apache Livy 批处理请求体中的 Spark AppName

Spark AppName in request body of Apache Livy for batch

如何在从 Apache Livy 提交批处理作业时设置 Spark App-Name?

您可以在 post 请求中使用 name 标签。

import json
import requests

host = 'http://ip:8998/batches'
headers = {'Content-Type': 'application/json'}

data = {
    'file': '/path/to/spark.jar',
    'className': 'class.to.Job',
    'numExecutors': 2,
    'executorMemory': '512m',
    'driverMemory': '512m',
    'name': 'Name your application'
}
r = requests.post(host, data=json.dumps(data), headers=headers)