<?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 cannot read Hive managed table in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367523#M239928</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/75213"&gt;@ChethanYM&lt;/a&gt;&amp;nbsp;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestion by recreating the spark session&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt;&amp;gt;&amp;gt; conf = spark.sparkContext._conf.setAll([('spark.sql.htl.check','false'), ('mapreduce.input.fileinputformat.input.dir.recursive','true')])
&amp;gt;&amp;gt;&amp;gt; spark.sparkContext.stop()
&amp;gt;&amp;gt;&amp;gt; spark = SparkSession.builder.config(conf=conf).getOrCreate()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine. Thank you very much.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2023 02:40:33 GMT</pubDate>
    <dc:creator>BrianChan</dc:creator>
    <dc:date>2023-04-03T02:40:33Z</dc:date>
    <item>
      <title>Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367399#M239891</link>
      <description>&lt;P&gt;Hi all, I am practicing spark.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using pyspark to query table in Hive, I can retrieve the data from an external table but query a internal table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error message:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt;&amp;gt;&amp;gt; spark.read.table("exams").count()
23/03/30 22:28:50 WARN conf.HiveConf: HiveConf of name hive.masking.algo does not exist
Hive Session ID = eb0a9583-da34-4c85-9a1b-db790d126fb1
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/spark/python/pyspark/sql/readwriter.py", line 301, in table
    return self._df(self._jreader.table(tableName))
  File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py",
  File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/spark/python/pyspark/sql/utils.py", line 69, in deco
    raise AnalysisException(s.split(': ', 1)[1], stackTrace)
pyspark.sql.utils.AnalysisException: u'\nSpark has no access to table `default`.`exams`. Clients can access this table only ifMANAGEDINSERTWRITE,HIVEMANAGESTATS,HIVECACHEINVALIDATE,CONNECTORWRITE.\nThis table may be a Hive-managed ACID table, or require some other capability that Spark\ncurrently does not implement;'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that spark cannot read a ACID Hive table. it there any work around?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 05:50:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367399#M239891</guid>
      <dc:creator>BrianChan</dc:creator>
      <dc:date>2023-03-31T05:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367425#M239896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you use "spark.sql.htl.check=false" parameter in your spark job and give a try?&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Regards,&lt;/P&gt;&lt;P class="p1"&gt;Chethan YM&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 09:43:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367425#M239896</guid>
      <dc:creator>ChethanYM</dc:creator>
      <dc:date>2023-03-31T09:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367523#M239928</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/75213"&gt;@ChethanYM&lt;/a&gt;&amp;nbsp;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your suggestion by recreating the spark session&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;gt;&amp;gt;&amp;gt; conf = spark.sparkContext._conf.setAll([('spark.sql.htl.check','false'), ('mapreduce.input.fileinputformat.input.dir.recursive','true')])
&amp;gt;&amp;gt;&amp;gt; spark.sparkContext.stop()
&amp;gt;&amp;gt;&amp;gt; spark = SparkSession.builder.config(conf=conf).getOrCreate()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 02:40:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367523#M239928</guid>
      <dc:creator>BrianChan</dc:creator>
      <dc:date>2023-04-03T02:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367533#M239930</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/75213"&gt;@ChethanYM&lt;/a&gt;&amp;nbsp;Could you please explain further why spark can read Hive managed table by pass this parameter? Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 03:11:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/367533#M239930</guid>
      <dc:creator>BrianChan</dc:creator>
      <dc:date>2023-04-03T03:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/382930#M244749</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="UserName lia-user-name lia-user-rank-Super-Collaborator"&gt;&lt;SPAN class="lia-link-navigation lia-page-link lia-link-disabled lia-user-name-link"&gt;&lt;SPAN class=""&gt;ChethanYM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Could you please provide some link where I can find documentation about this conf (spark.sql.htl.check=false) ?&lt;/P&gt;&lt;P data-unlink="true"&gt;I could not find anythin in https://spark.apache.org/doc&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guilherme C P&lt;/P&gt;&lt;DIV class="simple-translate-light-theme"&gt;&lt;DIV&gt;&lt;DIV class="simple-translate-button isShow"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="simple-translate-panel "&gt;&lt;DIV class="simple-translate-result-wrapper"&gt;&lt;DIV class="simple-translate-move"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="simple-translate-result-contents"&gt;&lt;P class="simple-translate-result"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="simple-translate-candidate"&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 Jan 2024 14:16:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/382930#M244749</guid>
      <dc:creator>cardozogp</dc:creator>
      <dc:date>2024-01-31T14:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/392829#M248267</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You need to use Hive Warehouse Connector (HWC) to query Hive managed tables from Spark.&lt;BR /&gt;&lt;BR /&gt;Ref -&amp;nbsp;&lt;A href="https://docs.cloudera.com/cdp-private-cloud-base/7.1.9/integrating-hive-and-bi/topics/hive_hivewarehouseconnector_for_handling_apache_spark_data.html" target="_blank"&gt;https://docs.cloudera.com/cdp-private-cloud-base/7.1.9/integrating-hive-and-bi/topics/hive_hivewarehouseconnector_for_handling_apache_spark_data.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 06:09:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/392829#M248267</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2024-08-30T06:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Spark cannot read Hive managed table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/393671#M248526</link>
      <description>&lt;P&gt;This solution worked for eliminating error , but data is not being fetched from table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;empty data frame showing.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 04:19:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-cannot-read-Hive-managed-table/m-p/393671#M248526</guid>
      <dc:creator>kartheekb</dc:creator>
      <dc:date>2024-09-19T04:19:36Z</dc:date>
    </item>
  </channel>
</rss>

