<?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 Impala table definition in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Impala-table-definition/m-p/66658#M13688</link>
    <description>&lt;P&gt;&lt;SPAN&gt;After loading csv data into HDFS, I have seen below way to create a Hive external table(textfile format). Followed by creating Impala internal table(parquet format) like the&amp;nbsp;Hive external table. And it works.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My question: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1) Why should one go this roundabout way of creating a Hive table; and then an impala table from it? Why can't we directly create an external impala table (in parquet format)?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) Is there any issue with sticking to external tables only(without any internal tables) - given that my data is always bulk loaded directly into hdfs?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) When should one use "from_unixtime(unix_timestamp(as_of_date,"dd-MMM-yy"),'yyyy-MM-dd')"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;and store date as string vs storing date as timestamp in Impala?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;// sample external table defined below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;create EXTERNAL TABLE&amp;nbsp;my_external_table (&lt;BR /&gt;Col1&amp;nbsp;string,&lt;BR /&gt;as_of_date string,&lt;BR /&gt;Col3 string&lt;BR /&gt;)&lt;BR /&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;/P&gt;
&lt;P&gt;WITH SERDEPROPERTIES (&lt;BR /&gt;'separatorChar' = ',',&lt;BR /&gt;'quoteChar' = '"',&lt;BR /&gt;'escapeChar' = '\\'&lt;BR /&gt;)&lt;BR /&gt;STORED AS TEXTFILE&lt;BR /&gt;LOCATION "/data/my_data_files"&lt;BR /&gt;tblproperties("skip.header.line.count"="1");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// sample internal table defined below&lt;/P&gt;
&lt;P&gt;create table my_internal_table like my_external_table stored as parquet;&lt;/P&gt;
&lt;P&gt;insert into table&amp;nbsp;my_internal_table&lt;BR /&gt;select&lt;BR /&gt;Col1,&lt;BR /&gt;from_unixtime(unix_timestamp(as_of_date,"dd-MMM-yy"),'yyyy-MM-dd'),&lt;BR /&gt;Col3&lt;BR /&gt;from my_external_table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:08:15 GMT</pubDate>
    <dc:creator>toamitjain</dc:creator>
    <dc:date>2022-09-16T13:08:15Z</dc:date>
  </channel>
</rss>

