<?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: Spark sql and Hive tables in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25500#M3894</link>
    <description>&lt;P&gt;You can also just add the HIve jars to your app classpath.&lt;/P&gt;&lt;P&gt;The catch here is that Spark doesn't quite support the later version of Hive in CDH. This might work for what you're trying to do, but if you build your own, you're building for a slightly different version of Hive than you run here.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2015 14:21:36 GMT</pubDate>
    <dc:creator>srowen</dc:creator>
    <dc:date>2015-03-11T14:21:36Z</dc:date>
    <item>
      <title>Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22051#M3884</link>
      <description>&lt;P&gt;Hi, I installed Spark 1.1.0 and Hive 0.13, I try to run example code&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;# sc is an existing SparkContext.&lt;/SPAN&gt;
&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;pyspark.sql&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;HiveContext&lt;/SPAN&gt;
&lt;SPAN&gt;sqlContext&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;HiveContext&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sc&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;sqlContext&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"CREATE TABLE IF NOT EXISTS src (key INT, value STRING)"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;sqlContext&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"LOAD DATA LOCAL INPATH 'examples/src/main/resources/kv1.txt' INTO TABLE src"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;

&lt;SPAN&gt;# Queries can be expressed in HiveQL.&lt;/SPAN&gt;
&lt;SPAN&gt;results&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;sqlContext&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"FROM src SELECT key, value"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;collect&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; so I get error:&lt;/STRONG&gt;&lt;BR /&gt;Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf&lt;BR /&gt;at java.lang.Class.forName0(Native Method)&lt;BR /&gt;at java.lang.Class.forName(Class.java:190)&lt;BR /&gt;at py4j.reflection.TypeUtil.getClass(TypeUtil.java:265)&lt;BR /&gt;at py4j.reflection.TypeUtil.forName(TypeUtil.java:245)&lt;BR /&gt;at py4j.commands.ReflectionCommand.getUnknownMember(ReflectionCommand.java:153)&lt;BR /&gt;at py4j.commands.ReflectionCommand.execute(ReflectionCommand.java:82)&lt;BR /&gt;at py4j.GatewayConnection.run(GatewayConnection.java:207)&lt;BR /&gt;at java.lang.Thread.run(Thread.java:745)&lt;BR /&gt;Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf&lt;BR /&gt;at java.net.URLClassLoader$1.run(URLClassLoader.java:366)&lt;BR /&gt;at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;BR /&gt;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;at java.net.URLClassLoader.findClass(URLClassLoader.java:354)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:425)&lt;BR /&gt;at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)&lt;BR /&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:358)&lt;BR /&gt;... 8 more&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Everyone can help me?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:14:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22051#M3884</guid>
      <dc:creator>hogiabao2601</dc:creator>
      <dc:date>2022-09-16T09:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22075#M3885</link>
      <description>&lt;P&gt;Please help me!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2014 03:20:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22075#M3885</guid>
      <dc:creator>hogiabao2601</dc:creator>
      <dc:date>2014-11-28T03:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22082#M3886</link>
      <description>&lt;P&gt;You need to have the hive client jars in your classpath.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2014 15:02:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22082#M3886</guid>
      <dc:creator>harsha_v</dc:creator>
      <dc:date>2014-11-28T15:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22088#M3887</link>
      <description>&lt;P&gt;Thanks harsha_v&lt;SPAN&gt;,&lt;BR /&gt;but I don't know how to add the&amp;nbsp;&lt;SPAN&gt;hive client jars in my&amp;nbsp;classpath, can u explain clear more?&amp;nbsp;&lt;BR /&gt;thank you&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2014 16:18:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/22088#M3887</guid>
      <dc:creator>hogiabao2601</dc:creator>
      <dc:date>2014-11-28T16:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/23946#M3888</link>
      <description>&lt;P&gt;copy ur jars to&amp;nbsp;/usr/lib/spark/assembly/lib folder... then check...it should work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Shekhar Reddy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jan 2015 13:38:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/23946#M3888</guid>
      <dc:creator>shekharreddy</dc:creator>
      <dc:date>2015-01-22T13:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/24771#M3889</link>
      <description>&lt;P&gt;i tried to copy the jar "&amp;nbsp;hive-common-0.13.1-cdh5.3.0.jar " - which contains "&amp;nbsp;org.apache.hadoop.hive.conf.HiveConf " in&amp;nbsp;&lt;/P&gt;&lt;P&gt;" /usr/lib/spark/lib " but it still gives me the error :&lt;/P&gt;&lt;P&gt;java.lang.noclassdeffounderror: org.apache.hadoop.hive.conf.HiveConf&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 14:12:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/24771#M3889</guid>
      <dc:creator>tarekabouzeid91</dc:creator>
      <dc:date>2015-02-17T14:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25495#M3890</link>
      <description>&lt;P&gt;Hi Tarek,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you manage to solve this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing the same issue here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 13:30:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25495#M3890</guid>
      <dc:creator>guydou</dc:creator>
      <dc:date>2015-03-11T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25496#M3891</link>
      <description>&lt;P&gt;yes i had to rebuild spark to be compatible with hive&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://spark.apache.org/docs/1.2.0/building-spark.html"&gt;http://spark.apache.org/docs/1.2.0/building-spark.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this section :&amp;nbsp;&lt;/P&gt;&lt;P&gt;Building With Hive and JDBC Support&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 13:52:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25496#M3891</guid>
      <dc:creator>tarekabouzeid91</dc:creator>
      <dc:date>2015-03-11T13:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25498#M3892</link>
      <description>&lt;P&gt;I have spark 1.2 (CDH 5.3.1)&lt;/P&gt;&lt;P&gt;do you think I need also to build myself?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 13:57:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25498#M3892</guid>
      <dc:creator>guydou</dc:creator>
      <dc:date>2015-03-11T13:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25499#M3893</link>
      <description>&lt;P&gt;that solved my problem , as the version build with cloudera isn't build to hive&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 14:19:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25499#M3893</guid>
      <dc:creator>tarekabouzeid91</dc:creator>
      <dc:date>2015-03-11T14:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25500#M3894</link>
      <description>&lt;P&gt;You can also just add the HIve jars to your app classpath.&lt;/P&gt;&lt;P&gt;The catch here is that Spark doesn't quite support the later version of Hive in CDH. This might work for what you're trying to do, but if you build your own, you're building for a slightly different version of Hive than you run here.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 14:21:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25500#M3894</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2015-03-11T14:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25502#M3895</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 14:28:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/25502#M3895</guid>
      <dc:creator>guydou</dc:creator>
      <dc:date>2015-03-11T14:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spark sql and Hive tables</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/26757#M3896</link>
      <description>&lt;P&gt;I'm also seeing this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Strangely I am including the jar in the spark submit command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/usr/bin/spark-submit --class com.mycompany.myproduct.spark.sparkhive.Hive2RddTest --master spark://mycluster:7077 --executor-memory 8G --jars hive-common-0.13.1-cdh5.3.1.jar sparkhive.jar "/home/stunos/hive.json" &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this insufficient to add this to the classpath? It has worked for other dependencies so presumably spark copies the dependencies to the other nodes. I am puzzled by this exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can attempt to add this jar to&amp;nbsp;/opt/cloudera/parcels/CDH/spark/lib on each node but at this point it is only a voodoo guess since by my logic the command line argument should have been sufficient.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you think? Does this mean I probably have to build Spark?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 20:34:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-sql-and-Hive-tables/m-p/26757#M3896</guid>
      <dc:creator>Stunos</dc:creator>
      <dc:date>2015-04-24T20:34:48Z</dc:date>
    </item>
  </channel>
</rss>

