<?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 can I specify table output directory using SparkSQL? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153511#M24229</link>
    <description>&lt;P&gt;Exactly as you would in a hive CTAS:&lt;/P&gt;&lt;PRE&gt;%spark 
sc.parallelize(1 to 10).toDF.registerTempTable("pings_raw")

%sql 
create table pings 
   location '/path/to/pings'
as select * from pings_raw
&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Apr 2016 07:54:44 GMT</pubDate>
    <dc:creator>sball</dc:creator>
    <dc:date>2016-04-04T07:54:44Z</dc:date>
    <item>
      <title>How can I specify table output directory using SparkSQL?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153510#M24228</link>
      <description>&lt;P&gt;I'm using SparkSQL (local mode) in Zeppelin for development work. As I am not running on a cluster, I do not have /user/hive/warehouse directories. If I'm using strictly SQL, is there a way I can specify the directory of my newly created tables? How about setting the default output directories?&lt;/P&gt;&lt;P&gt;Failing Example:&lt;/P&gt;&lt;PRE&gt;%sql
create table pings as
select
  split(time, " ")[0] as month,
  split(time, " ")[2] as year,
  split(split(time, " ")[3], ":")[0] as hour,
  split(split(time, " ")[3], ":")[1] as minute,
  split(split(split(time, " ")[3], ":")[2], "\\.")[0] as second,
  substr(split(split(split(time, " ")[3], ":")[2], "\\.")[1],0, 3) as ms,
  *
from pings_raw
&lt;/PRE&gt;&lt;PRE&gt;MetaException(message:file:/user/hive/warehouse/pings is not a directory or unable to create one)
set zeppelin.spark.sql.stacktrace = true to see full stacktrace&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Apr 2016 04:26:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153510#M24228</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-04-03T04:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I specify table output directory using SparkSQL?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153511#M24229</link>
      <description>&lt;P&gt;Exactly as you would in a hive CTAS:&lt;/P&gt;&lt;PRE&gt;%spark 
sc.parallelize(1 to 10).toDF.registerTempTable("pings_raw")

%sql 
create table pings 
   location '/path/to/pings'
as select * from pings_raw
&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2016 07:54:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153511#M24229</guid>
      <dc:creator>sball</dc:creator>
      <dc:date>2016-04-04T07:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I specify table output directory using SparkSQL?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153512#M24230</link>
      <description>&lt;P&gt;Thanks, manually specifying the full path worked. Is there a way to set a default directory?&lt;/P&gt;&lt;P&gt;I've tried "set hive.metastore.warehouse.dir=my_dir" but it had no effect.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 10:05:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-I-specify-table-output-directory-using-SparkSQL/m-p/153512#M24230</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-04-04T10:05:13Z</dc:date>
    </item>
  </channel>
</rss>

