<?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: IllegalArgumentException when select with where clause on hive external table pointing to parquet data in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154809#M117250</link>
    <description>&lt;P&gt;yes, schema spark and schema hive are same.&lt;/P&gt;&lt;P&gt;also,&lt;/P&gt;&lt;P&gt;hive&amp;gt; describe table1&lt;/P&gt;&lt;P&gt;gives the three columns&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2016 17:11:39 GMT</pubDate>
    <dc:creator>hbouzelat</dc:creator>
    <dc:date>2016-07-28T17:11:39Z</dc:date>
    <item>
      <title>IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154807#M117248</link>
      <description>&lt;P&gt;Followed is
the workflow&lt;/P&gt;&lt;P&gt;Hive&amp;gt;create external table if not exists table1 (
C1 string,
C2 string,
C3 int)&lt;/P&gt;&lt;P&gt;  stored as parquet&lt;/P&gt;&lt;P&gt; location 'hdfs:/project/table1.parquet';&lt;/P&gt;&lt;P&gt;Parquet
data are created by spark as&lt;/P&gt;&lt;P&gt;  df.write.mode("overwrite").parquet('hdfs:/project/table1.parquet')&lt;/P&gt;&lt;P&gt;Hive&amp;gt;select * from table1 where C1='toto';&lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;SLF4J:
Failed to load class "org.slf4j.impl.StaticLoggerBinder".&lt;/P&gt;&lt;P&gt;SLF4J:
Defaulting to no-operation (NOP) logger implementation&lt;/P&gt;&lt;P&gt;SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#StaticLoggerBinder"&gt;http://www.slf4j.org/codes.html#StaticLoggerBinder&lt;/A&gt;
for further details.&lt;/P&gt;&lt;P&gt;Failed with exception java.io.IOException:java.lang.IllegalArgumentException:
Column [c1] was not found in schema!&lt;/P&gt;&lt;P&gt;Time taken: 0.254 seconds&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 17:00:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154807#M117248</guid>
      <dc:creator>hbouzelat</dc:creator>
      <dc:date>2016-07-28T17:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154808#M117249</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/12129/hbouzelat.html" nodeid="12129"&gt;@Hocine Bouzelat&lt;/A&gt; Can you please check if you have defined same column name while creating parquet file schema through spark? &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 17:05:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154808#M117249</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-07-28T17:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154809#M117250</link>
      <description>&lt;P&gt;yes, schema spark and schema hive are same.&lt;/P&gt;&lt;P&gt;also,&lt;/P&gt;&lt;P&gt;hive&amp;gt; describe table1&lt;/P&gt;&lt;P&gt;gives the three columns&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 17:11:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154809#M117250</guid>
      <dc:creator>hbouzelat</dc:creator>
      <dc:date>2016-07-28T17:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154810#M117251</link>
      <description>&lt;P&gt;can you please post the output of below command?&lt;/P&gt;&lt;PRE&gt;parquet-tools schema &amp;lt;parquet file path&amp;gt;
&lt;/PRE&gt;&lt;P&gt;If parquet-tools is not configured then please follow below link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Parquet/parquet-mr/tree/master/parquet-tools"&gt;https://github.com/Parquet/parquet-mr/tree/master/parquet-tools&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 17:19:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154810#M117251</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-07-28T17:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154811#M117252</link>
      <description>&lt;P&gt;Hi Jitendra,&lt;/P&gt;&lt;P&gt;followed is  the complete processs and very explicite&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;pyspark program&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt;data = [('C1_1',None,'C3_1'), ('C1_2','C2_2',None),('C1_3',None,None),(None,None,'C3_4'),('C1_5','C2_5','C3_5')] &lt;/PRE&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt;df = sqlContext.createDataFrame(data, ['C1', 'C2','C3']) &lt;/PRE&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt;df.printSchema() &lt;/PRE&gt;&lt;P&gt;root &lt;/P&gt;&lt;P&gt; |-- C1: string (nullable = true) &lt;/P&gt;&lt;P&gt; |-- C2: string (nullable = true) &lt;/P&gt;&lt;P&gt; |-- C3: string (nullable = true)&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt;df.show()&lt;/PRE&gt;&lt;P&gt;
+---------+-------+-------+&lt;/P&gt;&lt;P&gt;
|  C1      |  C2     |  C3    |  &lt;/P&gt;&lt;P&gt;+--------+-------+--------+ &lt;/P&gt;&lt;P&gt;| C1_1  |  null  | C3_1 | &lt;/P&gt;&lt;P&gt;| C1_2  | C2_2|  null   |&lt;/P&gt;&lt;P&gt;
| C1_3|  null    |  null   |  &lt;/P&gt;&lt;P&gt;| null   |  null   | C3_4  | &lt;/P&gt;&lt;P&gt;| C1_5| C2_5 | C3_5 | &lt;/P&gt;&lt;P&gt;+------+--------+-------+ &lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt;df.write.mode("overwrite").parquet('hdfs:/tmp/table1.parquet') &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;hdfs commands&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -ls /tmp/table1.parquet &lt;/PRE&gt;&lt;P&gt;Found 11 items &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/_SUCCESS
/tmp/table1.parquet/_common_metadata &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/_metadata &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00000-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00001-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00002-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00003-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00004-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00005-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00006-3b1ecab2-1942-47eb-b393-c6988876d4a1.gz.parquet &lt;/P&gt;&lt;P&gt;/tmp/table1.parquet/part-r-00007-3b1ecab2-1942-47eb-b393-c6988876d4 &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hive commands&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive&amp;gt;create external table table1 ( C1 string, C2 string, C3 string)
   stored as parquet 
   location 'hdfs:/tmp/table1.parquet'; &lt;/PRE&gt;&lt;P&gt;OK
Time taken: 6.469 seconds &lt;/P&gt;&lt;PRE&gt;hive&amp;gt;describe table1; &lt;/PRE&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;c1   string &lt;/P&gt;&lt;P&gt;c2   string &lt;/P&gt;&lt;P&gt;c3   string &lt;/P&gt;&lt;P&gt;Time taken: 1.455 seconds, &lt;/P&gt;&lt;P&gt;Fetched: 3 row(s) &lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select * from table1; &lt;/PRE&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". &lt;/P&gt;&lt;P&gt;SLF4J: Defaulting to no-operation (NOP) logger implementation &lt;/P&gt;&lt;P&gt;SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#StaticLoggerBinder" target="_blank"&gt;http://www.slf4j.org/codes.html#StaticLoggerBinder&lt;/A&gt; for further details. &lt;/P&gt;&lt;P&gt;C1_1    NULL    C3_1 &lt;/P&gt;&lt;P&gt;C1_2    C2_2    NULL &lt;/P&gt;&lt;P&gt;C1_3    NULL    NULL &lt;/P&gt;&lt;P&gt;NULL    NULL C3_4 &lt;/P&gt;&lt;P&gt;C1_5    C2_5    C3_5 &lt;/P&gt;&lt;P&gt;Time taken: 0.355 seconds, &lt;/P&gt;&lt;P&gt;Fetched: 5 row(s) &lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select * from table1 where C1='toto'; &lt;/PRE&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed with exception java.io.IOException:java.lang.IllegalArgumentException: Column [c1] was not found in schema! &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Time taken: 0.277 seconds &lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select * from table1 where c1='toto'; &lt;/PRE&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Failed with exception java.io.IOException:java.lang.IllegalArgumentException: Column [c1] was not found in schema! &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Time taken: 0.096 seconds&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 18:21:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154811#M117252</guid>
      <dc:creator>hbouzelat</dc:creator>
      <dc:date>2016-07-28T18:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154812#M117253</link>
      <description>&lt;P&gt;This seems to be an known issue, please set below parameter on hive shell before running select query.&lt;/P&gt;&lt;P&gt;set hive.optimize.ppd = false;&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/HIVE-11401"&gt;https://issues.apache.org/jira/browse/HIVE-11401&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 18:31:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154812#M117253</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-07-28T18:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154813#M117254</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/12129/hbouzelat.html" nodeid="12129"&gt;@Hocine Bouzelat&lt;/A&gt;please accept this answer if suggsted workaround worked for you. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 19:49:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154813#M117254</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-07-28T19:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: IllegalArgumentException when select with where clause on hive external table pointing to parquet data</title>
      <link>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154814#M117255</link>
      <description>&lt;P&gt;As workaround, the following insrt solves the inssue&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; set hive.optimize.ppd = false;&lt;/PRE&gt;&lt;P&gt;thnks @Jitendra Yada&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 21:58:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/IllegalArgumentException-when-select-with-where-clause-on/m-p/154814#M117255</guid>
      <dc:creator>hbouzelat</dc:creator>
      <dc:date>2016-07-28T21:58:53Z</dc:date>
    </item>
  </channel>
</rss>

