<?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: Trouble loading CSV data with embedded double quotes and  embedded commas into  HIVE Table in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325903#M229749</link>
    <description>&lt;P&gt;yes that was indeed a problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was about to comment on that&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 17:48:02 GMT</pubDate>
    <dc:creator>asish</dc:creator>
    <dc:date>2021-09-30T17:48:02Z</dc:date>
    <item>
      <title>Trouble loading CSV data with embedded double quotes and  embedded commas into  HIVE Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325878#M229740</link>
      <description>&lt;P&gt;I need to load the CSV data into hive table but i am facing issues with embedded double quotes in few column values as well embedded commas in other columns .&lt;BR /&gt;Because of this, wherever embedded double quotes and embedded commas are occured , the data from there not loading properly and filled with nulls.&lt;BR /&gt;I have tried using below openCSV serde options and all. But no luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;BR /&gt;WITH SERDEPROPERTIES (&lt;BR /&gt;"separatorChar" = "\t",&lt;BR /&gt;"quoteChar" = "'",&lt;BR /&gt;"escapeChar" = "\\"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;theCSV data looks like this&lt;/P&gt;&lt;P&gt;id,name,description,role&lt;BR /&gt;"1","peter","He is Data enginer"", "Senior Engineer"&lt;BR /&gt;"2","Anee","Hadoop Engineer"","Lead"&lt;BR /&gt;"3","James","Data, Architect"","Sr Architect"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hive data should look like this after loading&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Id&lt;/TD&gt;&lt;TD width="25%"&gt;Name&lt;/TD&gt;&lt;TD width="25%"&gt;Description&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%"&gt;Role&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;1&lt;/TD&gt;&lt;TD width="25%"&gt;peter&lt;/TD&gt;&lt;TD width="25%"&gt;He is Data Engineer&lt;/TD&gt;&lt;TD width="25%"&gt;Senior Engineer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;2&lt;/TD&gt;&lt;TD width="25%"&gt;anee&lt;/TD&gt;&lt;TD width="25%"&gt;Hadoop Engineer&lt;/TD&gt;&lt;TD width="25%"&gt;Lead&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;3&lt;/TD&gt;&lt;TD width="25%"&gt;james&lt;/TD&gt;&lt;TD width="25%"&gt;Data, Architect&lt;/TD&gt;&lt;TD width="25%"&gt;Sr Architect&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 14:35:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325878#M229740</guid>
      <dc:creator>cortland</dc:creator>
      <dc:date>2021-09-30T14:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble loading CSV data with embedded double quotes and  embedded commas into  HIVE Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325901#M229747</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/92410"&gt;@cortland&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to acheive,please find my testcase&lt;/P&gt;&lt;P&gt;abc.txt&lt;BR /&gt;====&lt;/P&gt;&lt;P&gt;"1","peter","He is Data enginer", "Senior Engineer"&lt;BR /&gt;"2","Anee","Hadoop Engineer","Lead"&lt;BR /&gt;"3","James","Data, Architect","Sr Architect"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;hdfs dfs -put abc.txt /user/hive/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;create external table test_csv(num string ,name string ,work string ,designation string )&lt;BR /&gt;row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;BR /&gt;with serdeproperties&lt;BR /&gt;(&lt;BR /&gt;"separatorChar" = ','&lt;BR /&gt;,"quoteChar" = '"'&lt;BR /&gt;)&lt;BR /&gt;STORED AS TEXTFILE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD DATA INPATH '/user/hive/abc.txt' INTO TABLE test_csv;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select * from test_csv&lt;BR /&gt;+---------------+----------------+---------------------+-----------------------+&lt;BR /&gt;| test_csv.num | test_csv.name | test_csv.work | test_csv.designation |&lt;BR /&gt;+---------------+----------------+---------------------+-----------------------+&lt;BR /&gt;| 1 | peter | He is Data enginer | Senior Engineer |&lt;BR /&gt;| 2 | Anee | Hadoop Engineer | Lead |&lt;BR /&gt;| 3 | James | Data, Architect | Sr Architect |&lt;BR /&gt;| 1 | peter | He is Data enginer | Senior Engineer |&lt;BR /&gt;| 2 | Anee | Hadoop Engineer | Lead |&lt;BR /&gt;| 3 | James | Data, Architect | Sr Architect |&lt;BR /&gt;+---------------+----------------+---------------------+-----------------------+&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please accept it as solution,if your queries are answered and the testcase works in your scenario.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:31:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325901#M229747</guid>
      <dc:creator>asish</dc:creator>
      <dc:date>2021-09-30T17:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble loading CSV data with embedded double quotes and  embedded commas into  HIVE Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325902#M229748</link>
      <description>&lt;P&gt;Thanks for your response Ashish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you see my test data , its having two double quotes (extra double quote ) in column values . thats where its creating problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"1","peter","He is Data enginer"", "Senior Engineer"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"2","Anee","Hadoop Engineer"","Lead"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"3","James","Data, Architect"","Sr Architect"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:39:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325902#M229748</guid>
      <dc:creator>cortland</dc:creator>
      <dc:date>2021-09-30T17:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble loading CSV data with embedded double quotes and  embedded commas into  HIVE Table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325903#M229749</link>
      <description>&lt;P&gt;yes that was indeed a problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was about to comment on that&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:48:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Trouble-loading-CSV-data-with-embedded-double-quotes-and/m-p/325903#M229749</guid>
      <dc:creator>asish</dc:creator>
      <dc:date>2021-09-30T17:48:02Z</dc:date>
    </item>
  </channel>
</rss>

