<?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: External Table from Parquet folder returns empty result in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66499#M77334</link>
    <description>&lt;P&gt;Thank you all,&lt;/P&gt;&lt;P&gt;I added..&lt;/P&gt;&lt;PRE&gt;PARTITIONED BY (`date` STRING, hour INT)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;..to the CREATE External TABLE sentence and then..&lt;/P&gt;&lt;DIV class="preformatted panel"&gt;&lt;DIV class="preformattedContent panelContent"&gt;&lt;PRE&gt;ALTER TABLE processed_data_p ADD PARTITION (`date`="2015-08-19", hour=20) LOCATION '/user/myuser/spark/proyecto1/date=2015-08-19/hour=20';&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;One option to avoid adding all partitions manually is:&lt;/P&gt;&lt;DIV class="preformatted panel"&gt;&lt;DIV class="preformattedContent panelContent"&gt;&lt;PRE&gt;alter table processed_data_p recover partitions;&lt;BR /&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 18 Apr 2018 08:13:17 GMT</pubDate>
    <dc:creator>messenjah00</dc:creator>
    <dc:date>2018-04-18T08:13:17Z</dc:date>
    <item>
      <title>External Table from Parquet folder returns empty result</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66425#M77330</link>
      <description>&lt;P&gt;Hi, I did search for similar issues but didn't find a perfect match for my case:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE processed_data LIKE PARQUET '/user/myuser/spark/proyecto1/date=2015-08-17/hour=21/part-00087-7a6eac40-0db4-4368-894c-72588f80dfd6.c000.snappy.parquet'

STORED AS PARQUET

LOCATION '/user/myuser/spark/proyecto1'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table creation works, but any query to the table will return 0 rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Query: SHOW CREATE TABLE processed_data
+---------------------------------------------------------------------------------------------------------------------------+
| result                                                                                                                    |
+---------------------------------------------------------------------------------------------------------------------------+
| CREATE EXTERNAL TABLE josemidb.processed_data (                                                                           |
|   window STRUCT&amp;lt;start:TIMESTAMP,end:TIMESTAMP&amp;gt; COMMENT 'Inferred from Parquet file.',                                     |
|   terminating_cellid BIGINT COMMENT 'Inferred from Parquet file.',                                                        |
|   termination_id BIGINT COMMENT 'Inferred from Parquet file.',                                                            |
|   termination_reason BIGINT COMMENT 'Inferred from Parquet file.',                                                        |
|   numcalls BIGINT COMMENT 'Inferred from Parquet file.'                                                                   |
| )                                                                                                                         |
| STORED AS PARQUET                                                                                                         |
| LOCATION 'hdfs://myhost:8020/user/myuser/spark/proyecto1'                                    |
| TBLPROPERTIES ('COLUMN_STATS_ACCURATE'='false', 'numFiles'='18', 'numRows'='-1', 'rawDataSize'='-1', 'totalSize'='67251') |
+---------------------------------------------------------------------------------------------------------------------------+&lt;/PRE&gt;&lt;P&gt;This shows numFiles = 18 which is right, but numRows = -1 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think my problem is that I'm not handling partitions the right way. Can you help me with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:06:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66425#M77330</guid>
      <dc:creator>messenjah00</dc:creator>
      <dc:date>2022-09-16T13:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: External Table from Parquet folder returns empty result</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66473#M77331</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/26814"&gt;@messenjah00&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Can you share with us the&amp;nbsp;&lt;SPAN&gt;proyecto1&lt;/SPAN&gt; table schema?&lt;BR /&gt;I think you must use&amp;nbsp;&lt;SPAN&gt;PARTITIONED BY in the create statement.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 23:04:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66473#M77331</guid>
      <dc:creator>AcharkiMed</dc:creator>
      <dc:date>2018-04-17T23:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: External Table from Parquet folder returns empty result</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66476#M77332</link>
      <description>&lt;P&gt;1. You need to add the appropriate PARTITION clause to your CREATE EXTERNAL TABLE. Looks like it should be PARTITIONED BY (`date` STRING)&lt;/P&gt;&lt;P&gt;2. You need to run ALTER TABLE RECOVER PARTITIONS to discover all the partitions for the table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that you should be good to go!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 23:59:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66476#M77332</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2018-04-17T23:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: External Table from Parquet folder returns empty result</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66477#M77333</link>
      <description>It looks like the path to the parquet file that you've used to infer the schema of the table has multiple directories that correspond to partitions (e.g., date=2015-08-17/hour=21).&lt;BR /&gt;&lt;BR /&gt;Create the table with the schema and partitioning specified, then use alter partition to add the per-partition files (&lt;A href="https://www.cloudera.com/documentation/enterprise/latest/topics/impala_parquet.html" target="_blank"&gt;https://www.cloudera.com/documentation/enterprise/latest/topics/impala_parquet.html&lt;/A&gt;)&lt;BR /&gt;&lt;BR /&gt;The -1 shown is probably from not running compute stats.</description>
      <pubDate>Wed, 18 Apr 2018 00:08:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66477#M77333</guid>
      <dc:creator>vercegovac</dc:creator>
      <dc:date>2018-04-18T00:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: External Table from Parquet folder returns empty result</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66499#M77334</link>
      <description>&lt;P&gt;Thank you all,&lt;/P&gt;&lt;P&gt;I added..&lt;/P&gt;&lt;PRE&gt;PARTITIONED BY (`date` STRING, hour INT)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;..to the CREATE External TABLE sentence and then..&lt;/P&gt;&lt;DIV class="preformatted panel"&gt;&lt;DIV class="preformattedContent panelContent"&gt;&lt;PRE&gt;ALTER TABLE processed_data_p ADD PARTITION (`date`="2015-08-19", hour=20) LOCATION '/user/myuser/spark/proyecto1/date=2015-08-19/hour=20';&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;One option to avoid adding all partitions manually is:&lt;/P&gt;&lt;DIV class="preformatted panel"&gt;&lt;DIV class="preformattedContent panelContent"&gt;&lt;PRE&gt;alter table processed_data_p recover partitions;&lt;BR /&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:13:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/External-Table-from-Parquet-folder-returns-empty-result/m-p/66499#M77334</guid>
      <dc:creator>messenjah00</dc:creator>
      <dc:date>2018-04-18T08:13:17Z</dc:date>
    </item>
  </channel>
</rss>

