<?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>topic Re: I've set the partition mode to nonstrict in hive but spark is not seeing it in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29617#M21340</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;我也遇到类似问题了，通过上面的方法解决了，谢谢@peyman !&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;class JavaSparkSessionSingletonUtil {
private static transient SparkSession instance = null;
public static SparkSession getInstance(String appName) {
SparkSession.clearDefaultSession();
if (instance == null) {
instance = SparkSession.builder().appName(appName)
.config("hive.exec.dynamic.partition", "true")
.config("hive.exec.dynamic.partition.mode", "nonstrict")
//.config("spark.sql.warehouse.dir", new File("spark-warehouse").getAbsolutePath())
// .config("spark.driver.allowMultipleContexts", "true")
.enableHiveSupport().getOrCreate();
}
return instance;
}
}&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2018 01:44:18 GMT</pubDate>
    <dc:creator>jinyong_lu</dc:creator>
    <dc:date>2018-01-05T01:44:18Z</dc:date>
    <item>
      <title>I've set the partition mode to nonstrict in hive but spark is not seeing it</title>
      <link>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29614#M21337</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I've got a table I want to add some data to and it's partitoned. I want to use dynamic partitioning but I get this error &lt;/P&gt;
&lt;P&gt;org.apache.spark.SparkException: Dynamic partition strict mode requires at least one static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict&lt;/P&gt;&lt;P&gt;&lt;/P&gt; at org.apache.spark.sql.hive.execution.InsertIntoHiveTable.sideEffectResult$lzycompute(InsertIntoHiveTable.scala:168)&lt;P&gt;&lt;/P&gt; at org.apache.spark.sql.hive.execution.InsertIntoHiveTable.sideEffectResult(InsertIntoHiveTable.scala:127)&lt;P&gt;&lt;/P&gt; at org.apache.spark.sql.hive.execution.InsertIntoHiveTable.doExecute(InsertIntoHiveTable.scala:263)
&lt;P&gt;I've set &lt;/P&gt;
&lt;P&gt;hive.exec.dynamic.partition.mode=nonstrict &lt;/P&gt;
&lt;P&gt;to nonstrict and I've restarted hive in ambari. But when I re run the spark-shell job I still get the error?&lt;/P&gt;
&lt;P&gt;Should I set it elsewhere, in the hive config?&lt;/P&gt;
&lt;P&gt;here is the command &lt;/P&gt;
&lt;P&gt;df2.write.mode("append").partitionBy("p_date", "p_store_id").saveAsTable("TLD.ticket_pa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;yment_testinsert")
&lt;P&gt;df2 is a dataframe with a bunch of csv data read into it.&lt;/P&gt;
&lt;P&gt;I've tried setting it in my spark-shell command&lt;/P&gt;
&lt;P&gt;spark-shell --master yarn-client --packages com.databricks:spark-csv_2.11:1.4.0 --num-executors 4 --executor-cores 5 --executor-memory 8G --queue hadoop-capq --conf "hive.exec.dynamic.partition.mode=nonstrict" &lt;/P&gt;
&lt;P&gt;but I get this warning&lt;/P&gt;
&lt;P&gt;Warning: Ignoring non-spark config property: hive.exec.dynamic.partition.mode=nonstrict&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 20:22:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29614#M21337</guid>
      <dc:creator>max522over</dc:creator>
      <dc:date>2016-06-09T20:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: I've set the partition mode to nonstrict in hive but spark is not seeing it</title>
      <link>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29615#M21338</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;hiveContext.setConf("hive.exec.dynamic.partition", "true") hiveContext.setConf("hive.exec.dynamic.partition.mode", "nonstrict")
&lt;P&gt;&lt;/P&gt; 
&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/31341498/save-spark-dataframe-as-dynamic-partitioned-table-in-hive" target="test_blank"&gt;http://stackoverflow.com/questions/31341498/save-spark-dataframe-as-dynamic-partitioned-table-in-hive&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 16:44:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29615#M21338</guid>
      <dc:creator>User16789201666</dc:creator>
      <dc:date>2016-06-10T16:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: I've set the partition mode to nonstrict in hive but spark is not seeing it</title>
      <link>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29616#M21339</link>
      <description>&lt;P&gt;I got it working. This was exactly what I needed. Thank you @Peyman Mohajerian​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 22:53:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29616#M21339</guid>
      <dc:creator>max522over</dc:creator>
      <dc:date>2016-06-13T22:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: I've set the partition mode to nonstrict in hive but spark is not seeing it</title>
      <link>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29617#M21340</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;我也遇到类似问题了，通过上面的方法解决了，谢谢@peyman !&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;class JavaSparkSessionSingletonUtil {
private static transient SparkSession instance = null;
public static SparkSession getInstance(String appName) {
SparkSession.clearDefaultSession();
if (instance == null) {
instance = SparkSession.builder().appName(appName)
.config("hive.exec.dynamic.partition", "true")
.config("hive.exec.dynamic.partition.mode", "nonstrict")
//.config("spark.sql.warehouse.dir", new File("spark-warehouse").getAbsolutePath())
// .config("spark.driver.allowMultipleContexts", "true")
.enableHiveSupport().getOrCreate();
}
return instance;
}
}&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 01:44:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-ve-set-the-partition-mode-to-nonstrict-in-hive-but-spark-is/m-p/29617#M21340</guid>
      <dc:creator>jinyong_lu</dc:creator>
      <dc:date>2018-01-05T01:44:18Z</dc:date>
    </item>
  </channel>
</rss>

