Background:
In the process of doing the project, the Hive table is not a non-Chinese text segment. In the recently done project encountered the need to execute the query script on the Beeline interface, but the script contains Chinese, the normal script is written in text, paste into the Beeline window run, found that Chinese is garbled, and the carriage return execution also throws an error.
Solution:
Using the "Beeline-f file" to solve the problem, in my needs, this solution really solves the problem.
Required Business statement:
Use x_hive_db; Create Table as Select * from where type=' common ';
1, the need to first create a local file: Script.txt, in the Script.txt to write the above business needs;
2. Set Text encoding format
;
3, and placed on the Yarn Proxy Server (CentOS);
4. Execute the statement:
-F file path
Hive: Pasting a SQL script containing Chinese into Beeline client running Chinese garbled