[ https://issues.apache.org/jira/browse/AMBARI-18961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15837697#comment-15837697 ]
JaySenSharma edited comment on AMBARI-18961 at 1/25/17 1:02 PM: ---------------------------------------------------------------- On further analysis, This issue looks like more specific to "hive". Following are the steps used to validate the same. ================================ Ambari 2.4.2 / Hive1.5 view / HDP 2.5.3 ================================ In the Ambari Hive View executed the following query: {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} . was (Author: jaysensharma): On further analysis, This issue looks like more specific to "hive". Following are the steps used to validate the same. ================================ Ambari 2.4.2 / Hive1.5 view / HDP 2.5.3 ================================ In the Ambari Hive View executed the following query: {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.> INSERT INTO currency2 VALUES (1, "£€₡"); 0: jdbc:hive2://erie3.example.com:2181,erie1.> SELECT * FROM currency2; +---------------+-----------------+--+ | currency2.id | currency2.name | +---------------+-----------------+--+ | 1 | ��� | +---------------+-----------------+--+ {code} . > Ambari HiveView does not create or upload script in UTF-8 format > ---------------------------------------------------------------- > > Key: AMBARI-18961 > URL: https://issues.apache.org/jira/browse/AMBARI-18961 > Project: Ambari > Issue Type: Bug > Components: ambari-views > Affects Versions: 2.4.1 > Environment: All > Reporter: JaySenSharma > Assignee: JaySenSharma > Fix For: 2.5.0 > > Attachments: AMBARI-18961.patch, Result.png > > > - When we run an insert query with some special character in the Hive > (Hive-next) View then we see that the values are not being reflected > properly. The special characters are being replaced with "?" > Example: > {code} > CREATE table test (id int, name string); > insert into test values (100, "€"); > insert into test values (200, "$"); > insert into test values (300, "£"); > insert into test values (400, "₡"); > SELECT * FROM test LIMIT 100; > {code} > - Once the above script is executed then we will see the output something > like "HiveView_UTF-8_Issue.png" (attached) -- This message was sent by Atlassian JIRA (v6.3.4#6332)