<?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: separatorChar setting ignored ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/27883#M5921</link>
    <description>This is a reported bug, you can workaround with this issue by breaking statement "CREATE TABLE ... AS SELECT ..." from one step into two steps.

1) Create table first with definitions:
CREATE TABLE separator_test (
id int,
name string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES ("separatorChar" = "\t","quoteChar"="\"","escapeChar"="\\")
STORED AS TEXTFILE;

2) Then insert data into the newly created table:
INSERT OVERWRITE TABLE separator_test SELECT * FROM table_name;

This will force Hive to by pass the bug and insert data correctly.</description>
    <pubDate>Sun, 24 May 2015 23:48:26 GMT</pubDate>
    <dc:creator>EricL</dc:creator>
    <dc:date>2015-05-24T23:48:26Z</dc:date>
    <item>
      <title>separatorChar setting ignored ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/27501#M5920</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following code to create a csv file as result of a select statement :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE TABLE Tablename&lt;BR /&gt;ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'&lt;BR /&gt;WITH SERDEPROPERTIES ("separatorChar" = "\t","quoteChar"="\"","escapeChar"="\\")&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;STORED AS TEXTFILE&lt;BR /&gt;LOCATION '[path]/filename'&lt;BR /&gt;AS&lt;BR /&gt;SELECT ... ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use "separatorChar" = "|" as well, but that seems not to work either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I always get a result that uses comma as separator. Does anybody see any typo or error in my statement or does anybody know about problems with using the separatorChar setting of the CSV Serde ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example line of resulting csv file :&lt;/P&gt;&lt;P&gt;"1","Steven","12345678","2014-08-06","2014-08-06","1.0","0.0","PC","","","","","","","","","",""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:29:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/27501#M5920</guid>
      <dc:creator>MarcusB</dc:creator>
      <dc:date>2022-09-16T09:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: separatorChar setting ignored ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/27883#M5921</link>
      <description>This is a reported bug, you can workaround with this issue by breaking statement "CREATE TABLE ... AS SELECT ..." from one step into two steps.

1) Create table first with definitions:
CREATE TABLE separator_test (
id int,
name string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES ("separatorChar" = "\t","quoteChar"="\"","escapeChar"="\\")
STORED AS TEXTFILE;

2) Then insert data into the newly created table:
INSERT OVERWRITE TABLE separator_test SELECT * FROM table_name;

This will force Hive to by pass the bug and insert data correctly.</description>
      <pubDate>Sun, 24 May 2015 23:48:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/27883#M5921</guid>
      <dc:creator>EricL</dc:creator>
      <dc:date>2015-05-24T23:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: separatorChar setting ignored ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/28018#M5922</link>
      <description>&lt;P&gt;Small remark : In addition Eric later on gave me the advice to include the CSV Serde, because the statement still didn't run successfully.&lt;/P&gt;&lt;P&gt;This is vital, as this serde is located at Hive standard lib, the "add jar" should not be necessary, but at this point in time seems to be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is that maybe important additional piece of information from Eric who worked on the case I created later after posting my question here at the community :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ADD JAR /opt/cloudera/parcels/CDH/lib/hive/lib/opencsv-2.3.jar;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do "ls /opt/cloudera/parcels/CDH/lib/hive/lib/opencsv*" to see whether you have the same version as mine, then try again.&lt;/P&gt;&lt;P&gt;The problem seems to be fixed in 5.4." (remark :&amp;nbsp;my CDH version was 5.3.3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With adding the serde jar and creating the table before executing insert overwrite table statement, the separatorChar was used and I got the table format I needed.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 07:40:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/28018#M5922</guid>
      <dc:creator>MarcusB</dc:creator>
      <dc:date>2015-05-28T07:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: separatorChar setting ignored ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/28029#M5923</link>
      <description>&lt;P&gt;Thank you so much for posting the additional solution information MarcusB. It is greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 12:46:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/separatorChar-setting-ignored/m-p/28029#M5923</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2015-05-28T12:46:28Z</dc:date>
    </item>
  </channel>
</rss>

