Spark can't read an Orc table (returns empty table)
<p>Do I have to do anything special to be able to read Orc tables with Spark?</p>

<p>I have two table copies in txt and orc. When reading txt table everything is ok. When reading orc table I get no errors but spark returns an empty table. </p>

<p>Here is my code in python:</p>

<pre><code>import pyspark
CONF = (pyspark.SparkConf().setMaster("yarn-client"))
sc = pyspark.SparkContext(conf = CONF)

from pyspark.sql import HiveContext

sq = HiveContext(sc)
df = sq.sql(""" select * from sample_07 """)

print df.show(10)
</code></pre>

<p><strong>UPDATE:</strong></p>

<p>If I specify the path to data stored in sample_07 and register it as temporary table, it works though:</p>

<pre><code>sq = HiveContext(sc)
orcFile = sq.read.format("orc").load("/user/some/sample_07/")
orcFile.registerTempTable("tempTableName");
df = sq.sql("SELECT * FROM tempTableName  LIMIT 10 ")
</code></pre>

<p>Can you try adding the database name before the table name as a.table_name</p>

python apache-spark orc