<?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: how to insert semicolon in hive table in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220335#M182220</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; if I want to insert a question mark (?) to a column with datatype as int then what should be syntax?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 08:21:23 GMT</pubDate>
    <dc:creator>sadapa</dc:creator>
    <dc:date>2018-10-03T08:21:23Z</dc:date>
    <item>
      <title>how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220332#M182217</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data with semicolon as part of it.&lt;/P&gt;&lt;P&gt;I have to insert such data in to hive table.&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;create table semicolon(a string);&lt;/P&gt;&lt;P&gt;insert into semicolon values ('Mozilla/5.0 (iPhone; CPU iPhone OS 5_0)');&lt;/P&gt;&lt;P&gt;I am getting below error.&lt;/P&gt;&lt;P&gt;mismatched input '/' expecting ) near '...&lt;/P&gt;&lt;P&gt;could you please help&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 23:09:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220332#M182217</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2018-02-18T23:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220333#M182218</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208"&gt;@Mark&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;As you are trying to insert values having &lt;STRONG&gt;semicolon(;)&lt;/STRONG&gt; in it, hive thinks &lt;STRONG&gt;semi colon will be end of statement&lt;/STRONG&gt; even if you escape semicolon with &lt;STRONG&gt;back slash(\)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;To insert values with semicolon use &lt;STRONG&gt;unicode&lt;/STRONG&gt; for semicolon &lt;STRONG&gt;\u003B&lt;/STRONG&gt; in your insert values statement and back slash to escape /,space,).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Insert statement:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; insert into semicolon values ('Mozilla\/5\.0\ \(iPhone\u003B\ CPU\ iPhone\ OS\ 5_0\)');&lt;/PRE&gt;
&lt;PRE&gt;hive&amp;gt; select * from semicolon;
+------------------------------------------+--+
|                    a                     |
+------------------------------------------+--+
| Mozilla/5.0 (iPhone; CPU iPhone OS 5_0)  |
+------------------------------------------+--+&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;(or)&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;keep your data file into &lt;STRONG&gt;HDFS directory&lt;/STRONG&gt; and create &lt;STRONG&gt;semicolon table&lt;/STRONG&gt; with string datatype,&lt;STRONG&gt; pointing to that HDFS directory.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Semicolon Table reading from HDFS directory:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select * from semicolon;
+------------------------------------------+--+
|                    a                     |
+------------------------------------------+--+
| Mozilla/5.0 (iPhone; CPU iPhone OS 5_0)  |
+------------------------------------------+--+&lt;/PRE&gt;&lt;P&gt;Results will be same from both ways.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 00:16:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220333#M182218</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-02-19T00:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220334#M182219</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 05:25:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220334#M182219</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2018-02-20T05:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220335#M182220</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; if I want to insert a question mark (?) to a column with datatype as int then what should be syntax?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 08:21:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220335#M182220</guid>
      <dc:creator>sadapa</dc:creator>
      <dc:date>2018-10-03T08:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220336#M182221</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/91216/sadapa.html" nodeid="91216"&gt;@sadapa&lt;/A&gt;&lt;P&gt;Try with  &lt;STRONG&gt;\u003F(unicode for ?)&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; select('Hi How Are You\u003F');
+------------------+--+
|       _c0        |
+------------------+--+
| Hi How Are You?  |
+------------------+--+&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Oct 2018 08:37:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220336#M182221</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-10-03T08:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220337#M182222</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;Thank you for the update.


1) I have created two tables, one for datatype int and one for string.


 create table test001_int(ida int);


 create table test001_string(ida string);


2) When I try to insert " ? " to string table I am able to insert successfully 


insert into test001_string values('?');


select * from test001_string;
+---------------------+--+
| test001_string.ida  |
+---------------------+--+
| ?                   |
+---------------------+--+






3) When I try to insert " ? " to int table I am getting below Error


insert into test001_int values(?);
Error: Error while compiling statement: FAILED: ParseException line 1:31 cannot recognize input near '?' ')' '&amp;lt;EOF&amp;gt;' in value row constructor (state=42000,code=40000)




insert into test001_int values('?');


select * from test001_int;
+------------------+--+
| test001_int.ida  |
+------------------+--+
| NULL             |
+------------------+--+




insert into test001_int values('\u003F');


select * from test001_int;
+------------------+--+
| test001_int.ida  |
+------------------+--+
| NULL             |
| NULL             |
+------------------+--+


So my question is how can I insert " ? " in column with INT datatype (NOT string) and for select query I am getting NULL is there any different way to display " ? " in select query.
&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 02:09:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220337#M182222</guid>
      <dc:creator>sadapa</dc:creator>
      <dc:date>2018-10-04T02:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220338#M182223</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/91216/sadapa.html" nodeid="91216"&gt;@sadapa&lt;/A&gt;&lt;P&gt;you can never insert a "?" in to a column which has a datatype int.&lt;/P&gt;&lt;P&gt;because you can never find a number as "?", and hive knows it.&lt;/P&gt;&lt;P&gt;I am not sure why you want to do that, but if you want to still convert a "?" in to a number, which you want to change it later, you can try ascii()&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 20:35:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220338#M182223</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2018-10-16T20:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert semicolon in hive table</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220339#M182224</link>
      <description>&lt;P&gt;For some reason, th&lt;STRONG&gt;e u&lt;/STRONG&gt;nicode &lt;STRONG&gt;\u003B &lt;/STRONG&gt;translates to&lt;STRONG&gt; ) &lt;/STRONG&gt;for me&lt;STRONG&gt;. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Beeline version 1.1.0-cdh5.13.3 by Apache Hive
0: jdbc:hive2://gbrdsr000002995.intranet.barc&amp;gt; select '\u003B' as col; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+------+--+ &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| col  | &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+------+&lt;/STRONG&gt;&lt;STRONG&gt;--+ &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| )    | &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+------+--+&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have tried &lt;STRONG&gt;"\u0059"&lt;/STRONG&gt; instead to replace semicolon (;) which works for me &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;0: jdbc:hive2://gbrdsr000002995.intranet.barc&amp;gt; select '\u0059' as col; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+------+--+ &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| col  | &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+------+--+ &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| ;    |&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
+------+--+&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 21:32:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-insert-semicolon-in-hive-table/m-p/220339#M182224</guid>
      <dc:creator>manhar_seewooth</dc:creator>
      <dc:date>2018-12-28T21:32:51Z</dc:date>
    </item>
  </channel>
</rss>

