Curious to know why use JDBC and beeline to insert into Hive table rather
than using Hive sql through beeline
create table testme(col1 varchar(30));
INSERT INTO testme VALUES ("Dougs' Diner");
0: jdbc:hive2://rhes564:10010/default> select * from testme;
+---------------+--+
| testme.col1 |
+---------------+--+
| Dougs' Diner |
+---------------+--+
Dr Mich Talebzadeh
LinkedIn *
https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
<https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>*
http://talebzadehmich.wordpress.com
On 30 March 2016 at 19:15, Douglas Rapp <[email protected]> wrote:
> Hi,
>
> I use JDBC and the beeline client to interact with a Hive 1.2.1 store.
>
> I have some string data that contains single quotes (as well as other
> special characters) that requires being escaped in order to be inserted
> into my tables. For example, the string "Doug's Diner":
>
> INSERT INTO my_table (some_col) VALUES ('Doug\'s Diner')
>
> What I am finding is that the single quote inside the string data is not
> merely escaped to get through the interface, but the escape character
> itself (the backslash) is also getting stored as part of the string. In
> other words, when I select the data out of my_table, I get "Doug\'s Diner"
> rather than "Doug's Diner".
>
> Is this expected behavior with Hive?
>
> Thanks,
> Doug
>