hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JaySenSharma (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-15927) HIve does not insert UTF-8 characters properly when insert query is triggered.
Date Wed, 15 Feb 2017 11:56:41 GMT
JaySenSharma created HIVE-15927:
-----------------------------------

             Summary: HIve does not insert UTF-8 characters properly when insert query is
triggered.
                 Key: HIVE-15927
                 URL: https://issues.apache.org/jira/browse/HIVE-15927
             Project: Hive
          Issue Type: Bug
          Components: Hive
    Affects Versions: 1.2.1, 1.2.0
         Environment: All
            Reporter: JaySenSharma


- 
If we create a table as following from Ambari Hive View (or using any other approach)

{code}
CREATE TABLE IF NOT EXISTS currency2 (id int, name string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES("serialization.encoding"='UTF-8','store.charset'='UTF-8', 'retrieve.charset'='UTF-8');

INSERT INTO currency2 VALUES (1, "£€₡");

SELECT * FROM currency2;
{code}


- Output from ambari side is attached as "Result.png"

Here we see that the queries were sent to the "hive" correctly as we see the following entries
appear in the "hiveserver2.log"
{code}
ssh root@hiveserevr2host
cd /var/log/hive
tail -f hiveserver2.log
{code}

Output of the log shows that hiveserver2 received the proper insert query statements from
Ambari Hive View.

{code}
2017-01-25 09:25:27,589 INFO  [HiveServer2-Handler-Pool: Thread-60]: parse.ParseDriver (ParseDriver.java:parse(185))
- Parsing command: INSERT INTO currency2 VALUES (1, "£€₡")

2017-01-25 09:25:28,337 INFO  [HiveServer2-Background-Pool: Thread-244]: exec.Task (TezTask.java:build(316))
- Dag name: INSERT INTO currency2 VALUES (1, "£€₡")(Stage-1)

2017-01-25 09:25:28,694 INFO  [HiveServer2-Background-Pool: Thread-244]: client.TezClient
(TezClient.java:submitDAGSession(577)) - Submitted dag to TezSession, sessionName=HIVE-bf038f08-853a-4850-80bc-7a6eaded3c2d,
applicationId=application_1485333705258_0007, dagName=INSERT INTO c
urrency1 VALUES (1, "£€₡")(Stage-1)
{code}

- Even the beeline fails to show the correct entry:
{code}
[root@erie3 ~]# su - hive

[hive@erie3 root]$ beeline
Beeline version 1.2.1000.2.5.3.0-37 by Apache Hive

beeline> !connect jdbc:hive2://erie3.example.com:2181,erie1.example.com:2181,erie4.example.com:2181,erie2.example.com:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

0: jdbc:hive2://erie3.example.com:2181,erie1.> SELECT * FROM currency2;
+---------------+-----------------+--+
| currency2.id  | currency2.name  |
+---------------+-----------------+--+
| 1             | ���             |
+---------------+-----------------+--+

{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message