Hive: Pasting a SQL script containing Chinese into Beeline client running Chinese garbled

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.