<?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: Merge content of a same file in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222468#M77363</link>
    <description>&lt;P&gt;maybe I get your question wrong, but you want to convert 1 line of the file into 1 line of the hive table right? Your target table has 8 columns, while the text file only has 4 columns/words?&lt;/P&gt;&lt;P&gt;To me it looks as if you don't do a text replace at all, please correct me if am wrong? &lt;/P&gt;&lt;P&gt;Col1: Word1 of file complete&lt;BR /&gt;Col2: Word2 of file complete&lt;BR /&gt;Col3: Word3 of file complete&lt;BR /&gt;Col4: Word4 of file complete&lt;BR /&gt;Col5: second part of Word1 (not sure if digits part, or just the last 3 chars or just half of the chars?)&lt;BR /&gt;Col6: Word2 of file complete&lt;BR /&gt;Col7: middlepart of Word1 (just the middle two char, or the two char around the split of Col5?)&lt;BR /&gt;Col8: Word3 of file complete&lt;/P&gt;&lt;P&gt;So it looks like you are populating three columns with the word1 of the file, word 2 and word 3 are populated into 2 columns each? The result needs to be a Hive table or a file? And is the input a file stored on hdfs or a stream where you receive line by line?&lt;BR /&gt;&lt;BR /&gt;If it is a file, you may try the serde feature of hive.&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Apr 2018 17:44:13 GMT</pubDate>
    <dc:creator>arald</dc:creator>
    <dc:date>2018-04-17T17:44:13Z</dc:date>
    <item>
      <title>Merge content of a same file</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222467#M77362</link>
      <description>&lt;P&gt;I have a requirement where I need to create a hive table which uses the same data multiple times.&lt;/P&gt;&lt;P&gt;In order to do that I'm having multiple replace text steps followed by a merge content.&lt;/P&gt;&lt;P&gt;File content is as below :&lt;/P&gt;&lt;P&gt;abc123 active true sometext &lt;/P&gt;&lt;P&gt;I want to read the file as below into hive table :&lt;/P&gt;&lt;P&gt;abc123;active;true;sometext;123;active;c1;true;&lt;/P&gt;&lt;P&gt;In order to achieve this I'm using replace text where first I read as below(regex replace):&lt;/P&gt;&lt;P&gt;abc123;active;true;sometext;&lt;/P&gt;&lt;P&gt;Then  &lt;/P&gt;&lt;P&gt;123;active;&lt;/P&gt;&lt;P&gt;And finally as &lt;/P&gt;&lt;P&gt;c1;true; &lt;/P&gt;&lt;P&gt;But I'm not able to merge content horizontally, is there a way to do it ? Or may be a easier way to achieve the same result. Any help will be appriciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:06:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222467#M77362</guid>
      <dc:creator>contactvivekjai</dc:creator>
      <dc:date>2022-09-16T13:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Merge content of a same file</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222468#M77363</link>
      <description>&lt;P&gt;maybe I get your question wrong, but you want to convert 1 line of the file into 1 line of the hive table right? Your target table has 8 columns, while the text file only has 4 columns/words?&lt;/P&gt;&lt;P&gt;To me it looks as if you don't do a text replace at all, please correct me if am wrong? &lt;/P&gt;&lt;P&gt;Col1: Word1 of file complete&lt;BR /&gt;Col2: Word2 of file complete&lt;BR /&gt;Col3: Word3 of file complete&lt;BR /&gt;Col4: Word4 of file complete&lt;BR /&gt;Col5: second part of Word1 (not sure if digits part, or just the last 3 chars or just half of the chars?)&lt;BR /&gt;Col6: Word2 of file complete&lt;BR /&gt;Col7: middlepart of Word1 (just the middle two char, or the two char around the split of Col5?)&lt;BR /&gt;Col8: Word3 of file complete&lt;/P&gt;&lt;P&gt;So it looks like you are populating three columns with the word1 of the file, word 2 and word 3 are populated into 2 columns each? The result needs to be a Hive table or a file? And is the input a file stored on hdfs or a stream where you receive line by line?&lt;BR /&gt;&lt;BR /&gt;If it is a file, you may try the serde feature of hive.&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 17:44:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222468#M77363</guid>
      <dc:creator>arald</dc:creator>
      <dc:date>2018-04-17T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Merge content of a same file</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222469#M77364</link>
      <description>&lt;P&gt;Thanks for the Answer Herald, your understanding of my question is correct. All I'm trying is to get the format correct for my hive table column names. I mean I just put the formatted file on the hdfs and read using the external hive table. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 18:11:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Merge-content-of-a-same-file/m-p/222469#M77364</guid>
      <dc:creator>contactvivekjai</dc:creator>
      <dc:date>2018-04-17T18:11:38Z</dc:date>
    </item>
  </channel>
</rss>

