1

How to set Spark App-Name while submitting batch job from Apache Livy?

Apurba Pandey
  • 1,061
  • 10
  • 21

1 Answers1

2

You can use name tag in your post request.

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)
lvnt
  • 487
  • 3
  • 10