<?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 do I create an ORC Hive table from Spark? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97300#M10736</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/332/vshukla.html" nodeid="332"&gt;@vshukla&lt;/A&gt;
&lt;P&gt;I  am also facing the same issue .. I saved the data in orc format from DF and created external hive table ..when I do show tables in hive context in spark it shows me the table  but I couldnt see any table in my hive warehouse so when I query the hive external table.  when I just create the hive table(no df no data processing ) using hivecontext table get created and able to query also .Unable to understand this strange behaviour . Am I misisng something ?&lt;/P&gt;&lt;P&gt;for ex : hiveContext.sql("CREATE   TABLE IF NOT EXISTS TestTable (name STRING, age STRING)")&lt;/P&gt;&lt;P&gt;shows me the table in hive also.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 09:56:32 GMT</pubDate>
    <dc:creator>DivyaGehlot13</dc:creator>
    <dc:date>2015-12-17T09:56:32Z</dc:date>
    <item>
      <title>How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97291#M10727</link>
      <description>&lt;P&gt;I'm currently using Spark 1.4 and I'm loading some data into a DataFrame using jdbc:&lt;/P&gt;&lt;P&gt;val jdbcDF = sqlContext.load("jdbc", options)&lt;/P&gt;&lt;P&gt;How can I save the jdbcDF DataFrame to a Hive table using the ORC file format?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:03:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97291#M10727</guid>
      <dc:creator>christopher_w_m</dc:creator>
      <dc:date>2015-11-19T11:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97292#M10728</link>
      <description>&lt;P&gt;df.write.format("orc") will get you there. &lt;/P&gt;&lt;P&gt;See:
&lt;A target="_blank" href="http://hortonworks.com/blog/bringing-orc-support-into-apache-spark/"&gt;http://hortonworks.com/blog/bringing-orc-support-into-apache-spark/&lt;/A&gt; or &lt;A target="_blank" href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_spark-guide/content/ch_orc-spark.html"&gt;http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_spark-guide/content/ch_orc-spark.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:07:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97292#M10728</guid>
      <dc:creator>vshukla</dc:creator>
      <dc:date>2015-11-19T11:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97293#M10729</link>
      <description>&lt;P&gt;Thanks for the helpful links! Should I create the Hive table ahead of time or could I do everything within spark?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:15:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97293#M10729</guid>
      <dc:creator>christopher_w_m</dc:creator>
      <dc:date>2015-11-19T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97294#M10730</link>
      <description>&lt;P&gt;You can just write out the DF as ORC and the underlying directory will be created. LMK, if this doesn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:24:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97294#M10730</guid>
      <dc:creator>vshukla</dc:creator>
      <dc:date>2015-11-19T11:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97295#M10731</link>
      <description>&lt;P&gt;The way I have done this is to first register a temp table in Spark and then leverage the sql method of the HiveContext to create a new table in hive using the data from the temp table. For example if I have a dataframe df and HiveContext hc the general process is:&lt;/P&gt;&lt;PRE&gt;df.registerTempTable("my_temp_table")
hc.sql("CREATE TABLE new_table_name STORED AS ORC  AS SELECT * from my_temp_table")&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:41:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97295#M10731</guid>
      <dc:creator>bwilson</dc:creator>
      <dc:date>2015-11-19T11:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97296#M10732</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/687/christopherwmenke.html" nodeid="687"&gt;@Kit Menke&lt;/A&gt; You can create within spark. Please see this &lt;A target="_blank" href="https://hortonworks.com/hadoop-tutorial/apache-spark-1-5-1-technical-preview-with-hdp-2-3/"&gt;https://hortonworks.com/hadoop-tutorial/apache-spark-1-5-1-technical-preview-with-hdp-2-3/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 11:52:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97296#M10732</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-11-19T11:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97297#M10733</link>
      <description>&lt;P&gt;Very interesting! I will try this out!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 23:39:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97297#M10733</guid>
      <dc:creator>christopher_w_m</dc:creator>
      <dc:date>2015-11-19T23:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97298#M10734</link>
      <description>&lt;P&gt;Yep, the ORC directory is created but a Hive table is not. &lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 23:41:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97298#M10734</guid>
      <dc:creator>christopher_w_m</dc:creator>
      <dc:date>2015-11-19T23:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97299#M10735</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/687/christopherwmenke.html" nodeid="687"&gt;@Kit Menke&lt;/A&gt; &lt;/P&gt;&lt;P&gt;If you want to access your table from hive, you have two options:&lt;/P&gt;&lt;P&gt;1- create table ahead and use df.write.fromat("orc")&lt;/P&gt;&lt;P&gt;2- use Brandon's suggestion here, register df as temp_table and do create table as select from temp_table.&lt;/P&gt;&lt;P&gt;See code examples here:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="https://community.hortonworks.com/questions/6023/orgapachesparksparkexception-task-failed-while-wri.html#answer-6048"&gt;https://community.hortonworks.com/questions/6023/orgapachesparksparkexception-task-failed-while-wri.html#answer-6048&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you use saveAsTable function, it will create a table in hive metastore, but hive wont be able to query it. Only spark can use the table with this method.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2015 09:33:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97299#M10735</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-12-12T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97300#M10736</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/332/vshukla.html" nodeid="332"&gt;@vshukla&lt;/A&gt;
&lt;P&gt;I  am also facing the same issue .. I saved the data in orc format from DF and created external hive table ..when I do show tables in hive context in spark it shows me the table  but I couldnt see any table in my hive warehouse so when I query the hive external table.  when I just create the hive table(no df no data processing ) using hivecontext table get created and able to query also .Unable to understand this strange behaviour . Am I misisng something ?&lt;/P&gt;&lt;P&gt;for ex : hiveContext.sql("CREATE   TABLE IF NOT EXISTS TestTable (name STRING, age STRING)")&lt;/P&gt;&lt;P&gt;shows me the table in hive also.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 09:56:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97300#M10736</guid>
      <dc:creator>DivyaGehlot13</dc:creator>
      <dc:date>2015-12-17T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97301#M10737</link>
      <description>&lt;P&gt;Divya,&lt;/P&gt;&lt;P&gt;What is the user account when DF is used to create the external Hive table?&lt;/P&gt;&lt;P&gt;What is the user account when you try to see the table in Hive (&amp;amp; did you use HiveCli or Hive/Beeline or some ODBC tool?)&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 10:21:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97301#M10737</guid>
      <dc:creator>vshukla</dc:creator>
      <dc:date>2015-12-17T10:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97302#M10738</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/332/vshukla.html" nodeid="332"&gt;@vshukla&lt;/A&gt; I am  logging in as hdfs user on HDP 2.3.2 sandbox &lt;/P&gt;&lt;P&gt;and using the same account to see tables in hive.Yes , I am using hive CLI  and even browsed HDFS files through Ambari .Couldnt see  any tables created.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2015 14:26:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97302#M10738</guid>
      <dc:creator>DivyaGehlot13</dc:creator>
      <dc:date>2015-12-18T14:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an ORC Hive table from Spark?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97303#M10739</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/99/bwilson.html" nodeid="99"&gt;@Brandon Wilson&lt;/A&gt; I tried your suggestion it creates the hive table but I get this error:&lt;/P&gt;&lt;P&gt;org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table.&lt;/P&gt;&lt;P&gt;and it does not load data into my table. do you have any idea how to solve this?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 22:45:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-do-I-create-an-ORC-Hive-table-from-Spark/m-p/97303#M10739</guid>
      <dc:creator>hoda_moradi2014</dc:creator>
      <dc:date>2016-03-25T22:45:48Z</dc:date>
    </item>
  </channel>
</rss>

