Efficient use of hive

Source: Internet
Author: User
Tags hadoop fs

Hive is often used in work, and hive can be used more efficiently with hvie configuration parameters.

Hive option:

Hive-F script. hql: read from the script. hql file and execute hql.

Hive-e 'select * From XXX': Specifies the hql to be executed when hive is started. In this way, hql is explained by Shell and then executed by hive, therefore, note the shell escape characters in hql.

Hive-S: hql is executed in quiet mode. In this way, only the hql execution results in the standard output have no progress information, so that the results can be filtered.

Hive-I. hiverc: Specifies the hiverc file to be started.

Hive -- help: displays help information

Hive -- serverice: Start hive service. available service: beeline CLI help hiveserver2 hiveserver Hwi jar lineage metastool rcfilecat

Hive -- service SERVICE_NAME -- help: displays the help information of hive service.

Hive -- Define/-D/-- hivevar: Use the command line to pass the hive variable.

Hive set var option:

You can view hive configuration parameters and all variables in the hive command line. Variables in hive have different namespaces and access permissions:

Hivevar: readable/writable: User-Defined variables

Hiveconf: readable/writable: hive wants to configure attributes

System: readable/writable: Java defines configuration attributes

Env: readable only: Shell environment variable

Set; display variables in hiveconf, hivevar, ENV, and System

Set hivevar/ENV/system: var_name: displays a variable in a specific space.

Set-V: displays all variables, including hadoop-related configurations.

Common hive configurations:

Set hive. cli. Print. header = true; Name of the output Column

Set hive. cli. Print. Current. DB = true; output current DB

Set hive. mapred. mode = nostrict; Use the nostrict mode to allow order by without limit

Set hive.exe C. mode. Local. Auto = true; try to execute hql in efficient local mode.


Hive QL Note: -- command

Hive executes HDFS cmd: DFS command, similar to hadoop FS command

Hive executes shell :! Shell_cmd

Hive history command:. hivehistory

Hive default configuration: hivedefault. xml. Template

Hive log configuration: hive-log4j.properties, change hive. Root. Logger = debug, the console can output debugging information to the console


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.