<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to post a Spark Job as JAR via Livy interactive REST interface in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/317335#M227130</link>
    <description>&lt;P&gt;second curl command which is for sessions may not work as there is no property called className in sessions REST API&lt;/P&gt;</description>
    <pubDate>Sun, 30 May 2021 03:53:18 GMT</pubDate>
    <dc:creator>mana</dc:creator>
    <dc:date>2021-05-30T03:53:18Z</dc:date>
    <item>
      <title>How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184286#M146424</link>
      <description>&lt;P&gt;I am new to Livy.  I am able to run scala code through Livy api POST statement as described here - &lt;/P&gt;&lt;P&gt;&lt;A href="https://livy.incubator.apache.org/examples/" target="_blank"&gt;https://livy.incubator.apache.org/examples/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How can I submit a Jar file using API?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 20:00:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184286#M146424</guid>
      <dc:creator>mukesh_chouhan</dc:creator>
      <dc:date>2018-07-15T20:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184287#M146425</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/87284/mukeshchouhan.html" nodeid="87284"&gt;@Mukesh Chouhan&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Try adding jars using the jars option while posting to session like described in the livy rest documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://livy.incubator.apache.org/docs/latest/rest-api.html" target="_blank"&gt;https://livy.incubator.apache.org/docs/latest/rest-api.html&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;curl -X POST -d '{"conf": {"jars": "hdfs://localhost:8020/tmp/package.jar"}}' -H "Content-Type: application/json" localhost:8998/sessions&lt;/PRE&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 20:27:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184287#M146425</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-07-15T20:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184288#M146426</link>
      <description>&lt;P&gt;Thanks for your quick reply &lt;A rel="user" href="https://community.cloudera.com/users/11048/falbani.html" nodeid="11048"&gt;@Felix Albani&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Suppose me Livy Server IP is on X.X.X.X (port 8999) and I am executing CURL from server with Y.Y.Y.Y &lt;/P&gt;&lt;P&gt;My jar file is present on server Y.Y.Y.Y at location /home/app/work&lt;/P&gt;&lt;P&gt;Does below command looks good to you?&lt;/P&gt;&lt;PRE&gt;curl -X POST -d '{"conf": {"kind": "spark" , "jars": "hdfs://Y.Y.Y.Y:8020/home/app/work/scalajar/helloworld.jar"}}' -H "Content-Type: application/json" -H "X-Requested-By: user" &lt;A href="http://X.X.X.X:8999/sessions" target="_blank"&gt;http://X.X.X.X:8999/sessions&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Also can I specify "kind": "spark" as above in my curl command?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 22:35:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184288#M146426</guid>
      <dc:creator>mukesh_chouhan</dc:creator>
      <dc:date>2018-07-15T22:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184289#M146427</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/87284/mukeshchouhan.html" nodeid="87284"&gt;@Mukesh Chouhan&lt;/A&gt; the above example is pointing to hdfs location for the jars. Is it possible for you to do the same and upload your jars to an hdfs location. Then point to the hdfs location as I'm doing above? &lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 23:16:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184289#M146427</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-07-15T23:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184290#M146428</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://community.hortonworks.com/questions/202477/how-to-post-a-spark-job-as-jar-via-livy-interactiv.html?childToView=203397#"&gt;@Felix Albani&lt;/A&gt; I will try that.&lt;/P&gt;&lt;P&gt;Is it possible to upload jar file which is present locally on my server from where I executing curl?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 11:51:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184290#M146428</guid>
      <dc:creator>mukesh_chouhan</dc:creator>
      <dc:date>2018-07-16T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184291#M146429</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/87284/mukeshchouhan.html" nodeid="87284"&gt;@Mukesh Chouhan&lt;/A&gt;&lt;P&gt;In order to use the jars present in local filesystem. Please follow below.&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;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://&amp;lt;livy.file.local-dir-whitelist&amp;gt;/xxx.jar".&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 15:17:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184291#M146429</guid>
      <dc:creator>sandyy006</dc:creator>
      <dc:date>2018-07-16T15:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184292#M146430</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/87284/mukeshchouhan.html" nodeid="87284"&gt;@Mukesh Chouhan&lt;/A&gt; AFAIK you can't submit your jars along with the code using the livy api. You need to place them in HDFS or Livy local file system in advanced. &lt;/P&gt;&lt;P&gt;Please if the above answers have helped remember to login and mark as Accepted.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 19:50:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184292#M146430</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-07-16T19:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184293#M146431</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11048/falbani.html" nodeid="11048"&gt;@Felix Albani&lt;/A&gt; I have tried below curl commands-&lt;/P&gt;&lt;PRE&gt;curl -X POST -d
'{"className": "com.company.scala.ScyllaSpanByTest" ,
"file":
"hdfs://dhdfsserver:8020/user/spark/jars/Test-assembly-0.1.jar"}'
-H "Content-Type: application/json" -H "X-Requested-By:
user" &lt;A href="http://livyserver:8999/batches" target="_blank"&gt;http://livyserver:8999/batches&lt;/A&gt;

curl -X POST -d
'{"conf": {"kind": "spark"
,"className": "com.company.scala.ScyllaSpanByTest" ,
"jars":
"hdfs://hdfsserver:8020/user/spark/jars/Test-assembly-0.1.jar"
}}' -H "Content-Type: application/json" -H "X-Requested-By:
user" &lt;A href="http://livyserver:8999/sessions" target="_blank"&gt;http://livyserver:8999/sessions&lt;/A&gt;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 20:41:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/184293#M146431</guid>
      <dc:creator>mukesh_chouhan</dc:creator>
      <dc:date>2018-07-18T20:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/299806#M219859</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this solution working for you?&lt;/P&gt;&lt;P&gt;I'm not able to upload the jar to the session in any way.&lt;/P&gt;&lt;P&gt;Uploading the same jar to a batch is working though.&lt;/P&gt;&lt;P&gt;Tried using :&lt;/P&gt;&lt;P&gt;hdfs://localhost:8020..,&lt;/P&gt;&lt;P&gt;hdfs://..&lt;/P&gt;&lt;P&gt;hdfs://...&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" rel="noopener"&gt;file:///&lt;/A&gt;&lt;/P&gt;&lt;P&gt;s3://&lt;/P&gt;&lt;P&gt;Nothing seems to be working.&lt;/P&gt;&lt;P&gt;Maybe you have any reason why?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 07:49:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/299806#M219859</guid>
      <dc:creator>eliadv</dc:creator>
      <dc:date>2020-07-16T07:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/317334#M227129</link>
      <description>&lt;P&gt;How to import scala object and call the main funtion in interactive using Livy REST API&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 03:50:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/317334#M227129</guid>
      <dc:creator>mana</dc:creator>
      <dc:date>2021-05-30T03:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to post a Spark Job as JAR via Livy interactive REST interface</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/317335#M227130</link>
      <description>&lt;P&gt;second curl command which is for sessions may not work as there is no property called className in sessions REST API&lt;/P&gt;</description>
      <pubDate>Sun, 30 May 2021 03:53:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-post-a-Spark-Job-as-JAR-via-Livy-interactive-REST/m-p/317335#M227130</guid>
      <dc:creator>mana</dc:creator>
      <dc:date>2021-05-30T03:53:18Z</dc:date>
    </item>
  </channel>
</rss>

