Created on 03-23-2017 12:25 PM - edited 09-16-2022 04:19 AM
Hi!
Im messing around in the sandbox trying to figure out how to load data with special characters. I created a test table running the following:
CREATE TABLE default.test (name STRING); ALTER TABLE default.test SET serdeproperties ('serialization.encoding'='UTF-8');
Next I tried in insert some data:
INSERT INTO default.test (name) VALUES ("Nordström");
But to my surprise, when i clicked "Execute" the text in the query editor changed to
INSERT INTO default.test (name) VALUES ("Nordstr??m");
Anyone knows why this is happening?
Thanks
Ulf
Created 03-23-2017 12:31 PM
Which version of ambari is it? It might be ambari 2.2.2 or below.
I re-read your question and your issue is with the "Query Editor" there wre some issues reported in earlier version of ambari like ambari 2.2.2 which are fixed in Ambari 2.4 please see: https://issues.apache.org/jira/browse/AMBARI-16713
In Ambari 2.2.2 or prior this error was occurring because the View was writing the Scripts in HDFS in non UTF format so when the query editor was reloading after clicking on the "Submit" button then while reading the script sontent from the HDFS it was getting it back with those junk characters (? characters). You should upgrade to ambari 2.4 if you are not already in that release.
.
.
After Ambari 2.4 (There seems to be another issue i encountered). (Not related to 'Query Editor' but more of hive side) I reported similar issue for hive. https://issues.apache.org/jira/browse/HIVE-15927
Please check the hive server log if ambari is passing the correct values to it? I found that ambari was passing correct value to hiveserver2 as it was properly printed in the hiveserver log but hive was not able to display it properly.
cd /var/log/hive tail -f hiveserver2.log
.
Created 03-23-2017 02:02 PM
Thanks for your input!
I'm on Ambari Version 2.4.0.0 so the "Multi byte character should be have been fixed".
My hiveserver2.log had failed to log the event but I had a look at the logfil at "/user/admin/hive/jobs/hive-job-410-2017-03-23_12-09/logs" instead:
INFO : Dag name: insert into default.test (n...("Nordstr??m")(Stage-1) INFO : INFO : Status: Running (Executing on YARN cluster with App id application_1489519726025_0035) INFO : Map 1: -/- INFO : Map 1: 0/1 INFO : Map 1: 0(+1)/1 INFO : Map 1: 0(+1)/1 INFO : Map 1: 1/1 INFO : Loading data to table default.test from hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/test/.hive-staging_hive_2017-03-23_12-09-20_037_6827545740182706493-63/-ext-10000 INFO : Table default.test stats: [numFiles=4, numRows=3, totalSize=37, rawDataSize=23]
Seems like the "ö" character were already replaced by "??" by then.
Created 06-04-2018 03:18 AM
Did anyone find the solution for this? I am going through the same problem. Ambari is version 2.4.