<?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 Aggregate multiple text files into one table in Hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Aggregate-multiple-text-files-into-one-table-in-Hive/m-p/134361#M97023</link>
    <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I've 100 text files in HFDS and I want to aggregate all of them into one big table in Hive (Having the Date as Key). How can I load this multiple files to one table created in hive?

Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2016 03:53:18 GMT</pubDate>
    <dc:creator>Stewart12586</dc:creator>
    <dc:date>2016-06-13T03:53:18Z</dc:date>
    <item>
      <title>Aggregate multiple text files into one table in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Aggregate-multiple-text-files-into-one-table-in-Hive/m-p/134361#M97023</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I've 100 text files in HFDS and I want to aggregate all of them into one big table in Hive (Having the Date as Key). How can I load this multiple files to one table created in hive?

Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 03:53:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Aggregate-multiple-text-files-into-one-table-in-Hive/m-p/134361#M97023</guid>
      <dc:creator>Stewart12586</dc:creator>
      <dc:date>2016-06-13T03:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate multiple text files into one table in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Aggregate-multiple-text-files-into-one-table-in-Hive/m-p/134362#M97024</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10082/vilaresantonio.html" nodeid="10082"&gt;@Pedro Rodgers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If schema type is same on all the 100 text files then better  to create a hive external table since you already have those files on HDFS.&lt;/P&gt;&lt;P&gt;Example: If you have all the files under "/user/test/dummy/data" directory than run below command to create the external hive table and point it to the hdfs location.&lt;/P&gt;&lt;PRE&gt;CREATE EXTERNAL TABLE user(
  userId BIGINT,
  type INT,
  level TINYINT,
  date String
)
COMMENT 'User Infomation'
PARTITIONED BY (date String)
LOCATION '/user/test/dummy/data';&lt;/PRE&gt;&lt;P&gt;Then, create the folder &lt;CODE&gt;date=2011-11-11&lt;/CODE&gt; inside &lt;CODE&gt;/user/test/dummy/data/&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;And put the data files of date 2011-11-11 into the folder, Once you done you also need to add the partition in the hive metastore.&lt;/P&gt;&lt;PRE&gt;ALTER TABLE user ADD PARTITION(date='2011-11-11');&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jun 2016 04:10:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Aggregate-multiple-text-files-into-one-table-in-Hive/m-p/134362#M97024</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-06-13T04:10:32Z</dc:date>
    </item>
  </channel>
</rss>

