<?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: In hdp 3.0 can't create hive table in spark failed in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202650#M164656</link>
    <description>&lt;PRE&gt;df.write.format("orc").mode("overwrite").saveAsTable("database.table-name")&lt;/PRE&gt;&lt;P&gt;When I create a Hive table through Spark, I am able to query the table from Spark but having issue while accessing table data through Hive. I get below error.&lt;BR /&gt;&lt;BR /&gt;Error: java.io.IOException: java.lang.IllegalArgumentException: bucketId out of range: -1 (state=,code=0)&lt;BR /&gt;&lt;BR /&gt;I am able to view table metadata.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 18:40:12 GMT</pubDate>
    <dc:creator>er_sharma_shant</dc:creator>
    <dc:date>2018-10-11T18:40:12Z</dc:date>
    <item>
      <title>In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202647#M164653</link>
      <description>&lt;P&gt;Hi ,just doing some testing on newly posted hdp 3.0. and the example failed . I tested same script on previous HDP platform, works fine. can someone advice it's hive's new feature or anything I have done wrong?&lt;/P&gt;&lt;PRE&gt;./bin/spark-submit examples/src/main/python/sql/hive.py&lt;/PRE&gt;&lt;P&gt;
	Hive Session ID = bf71304b-3435-46d5-93a9-09ef752b6c22
AnalysisExceptionTraceback (most recent call last)
/usr/hdp/3.0.0.0-1634/spark2/examples/src/main/python/sql/hive.py in &amp;lt;module&amp;gt;()
     44
     45     # spark is an existing SparkSession
     46     spark.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING) USING hive")
     47     spark.sql("LOAD DATA LOCAL INPATH 'examples/src/main/resources/kv1.txt' INTO TABLE src")
     48
/usr/hdp/3.0.0.0-1634/spark2/python/lib/pyspark.zip/pyspark/sql/session.py in sql(self, sqlQuery)
    714         [Row(f1=1, f2=u'row1'), Row(f1=2, f2=u'row2'), Row(f1=3, f2=u'row3')]
    715         """
    716         return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
    717
    718     @since(2.0)
/usr/hdp/3.0.0.0-1634/spark2/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py in __call__(self, *args)
   1255         answer = self.gateway_client.send_command(command)
   1256         return_value = get_return_value(
-&amp;gt; 1257             answer, self.gateway_client, self.target_id, self.name)
   1258
   1259         for temp_arg in temp_args:
/usr/hdp/3.0.0.0-1634/spark2/python/lib/pyspark.zip/pyspark/sql/utils.py in deco(*a, **kw)
     67                                              e.java_exception.getStackTrace()))
     68             if s.startswith('org.apache.spark.sql.AnalysisException: '):
     69                 raise AnalysisException(s.split(': ', 1)[1], stackTrace)
     70             if s.startswith('org.apache.spark.sql.catalyst.analysis'):
     71                 raise AnalysisException(s.split(': ', 1)[1], stackTrace) &lt;/P&gt;&lt;PRE&gt;AnalysisException: u'org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Table default.src failed strict managed table checks due to the following reason: 
	&lt;STRONG&gt;Table is marked as a managed table but is not transactional&lt;/STRONG&gt;.);'&lt;/PRE&gt;&lt;P&gt;much appreciated!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 04:19:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202647#M164653</guid>
      <dc:creator>dblive</dc:creator>
      <dc:date>2018-08-04T04:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202648#M164654</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10779/dalinqin.html" nodeid="10779"&gt;@dalin qin&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;In HDP 3.0, all managed tables should be transactional. Please enable ACID and make the table as transactional and try again.&lt;/P&gt;&lt;P&gt;You can read more about ACID here&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.0.0/managing-hive/content/hive_acid_operations.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP3/HDP-3.0.0/managing-hive/content/hive_acid_operations.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Please "Accept" the answer if this helps.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;-Aditya&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 09:24:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202648#M164654</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-08-04T09:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202649#M164655</link>
      <description>&lt;P&gt;hi Aditya,&lt;/P&gt;&lt;P&gt;Thank you for the response .&lt;/P&gt;&lt;P&gt;The issue was related to when using spark to write to hive ,now have to provide the table format as below &lt;/P&gt;&lt;PRE&gt;df.write.format("orc").mode("overwrite").saveAsTable("tt") # this run good
df.write.mode("overwrite").saveAsTable("tt")               # this command will fail &lt;/PRE&gt;&lt;P&gt;I didn't change anything on hive tab after hdp 3.0 installed . &lt;/P&gt;</description>
      <pubDate>Sun, 05 Aug 2018 14:38:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202649#M164655</guid>
      <dc:creator>dblive</dc:creator>
      <dc:date>2018-08-05T14:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202650#M164656</link>
      <description>&lt;PRE&gt;df.write.format("orc").mode("overwrite").saveAsTable("database.table-name")&lt;/PRE&gt;&lt;P&gt;When I create a Hive table through Spark, I am able to query the table from Spark but having issue while accessing table data through Hive. I get below error.&lt;BR /&gt;&lt;BR /&gt;Error: java.io.IOException: java.lang.IllegalArgumentException: bucketId out of range: -1 (state=,code=0)&lt;BR /&gt;&lt;BR /&gt;I am able to view table metadata.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 18:40:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202650#M164656</guid>
      <dc:creator>er_sharma_shant</dc:creator>
      <dc:date>2018-10-11T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202651#M164657</link>
      <description>&lt;P&gt;Hi Sharma,&lt;/P&gt;&lt;P&gt;Any update for your above issue, because I am also facing the same issue &lt;/P&gt;&lt;P&gt;Error: java.io.IOException: java.lang.IllegalArgumentException: bucketId out of range: -1 (state=,code=0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 14:12:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202651#M164657</guid>
      <dc:creator>sbgowtham_sb</dc:creator>
      <dc:date>2019-06-04T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: In hdp 3.0 can't create hive table in spark failed</title>
      <link>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202652#M164658</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I faced the same issue after setting the following properties, it is working fine.&lt;/P&gt;&lt;P&gt;set hive.mapred.mode=nonstrict;&lt;/P&gt;&lt;P&gt;set hive.optimize.ppd=true;&lt;/P&gt;&lt;P&gt;set hive.optimize.index.filter=true;&lt;/P&gt;&lt;P&gt;set hive.tez.bucket.pruning=true;&lt;/P&gt;&lt;P&gt;set hive.explain.user=false;&lt;/P&gt;&lt;P&gt;set hive.fetch.task.conversion=none;&lt;/P&gt;&lt;P&gt;set hive.support.concurrency=true;&lt;/P&gt;&lt;P&gt;set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 19:33:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/In-hdp-3-0-can-t-create-hive-table-in-spark-failed/m-p/202652#M164658</guid>
      <dc:creator>sbgowtham_sb</dc:creator>
      <dc:date>2019-06-04T19:33:49Z</dc:date>
    </item>
  </channel>
</rss>

