Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to post a Spark Job as JAR via Livy interactive REST interface

avatar

I am new to Livy. I am able to run scala code through Livy api POST statement as described here -

https://livy.incubator.apache.org/examples/

How can I submit a Jar file using API?

1 ACCEPTED SOLUTION

avatar

@Mukesh Chouhan

Try adding jars using the jars option while posting to session like described in the livy rest documentation:

https://livy.incubator.apache.org/docs/latest/rest-api.html

curl -X POST -d '{"conf": {"jars": "hdfs://localhost:8020/tmp/package.jar"}}' -H "Content-Type: application/json" localhost:8998/sessions

HTH

*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.

View solution in original post

10 REPLIES 10

avatar
@Mukesh Chouhan

In order to use the jars present in local filesystem. Please follow below.

1. Place the jars in a directory on livy node and add the directory to `livy.file.local-dir-whitelist`.This configuration should be set in livy.conf.

2. Add all the required jars to "jars" field in the curl command, note it should be added in URI format with "file" scheme, like "file://<livy.file.local-dir-whitelist>/xxx.jar".