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