Directory:
Initial Hive
Hive Installation and Configuration
Hive built-in operator and function development
Hive JDBC
Hive parameters
Hive Advanced Programming
Hive QL
Hive Shell Basic Operations
Hive optimization
Hive Architecture
The principle of hive
Supporting video Courses
Part I: Hive bin script introduces the scripts under Hive bin Introduction Ext hive Hive-config Part Two: Hive Shell basic Operations Hive command line hive [-hiveconf x=y]* [&L T;-i filename>]* [<-f filename>|<-e query-string>] [-s]-i initializing from File hql·-e Executes the specified HQL -f from the command line executes the HQL script-v outputs the HQL statements executed to the console-p <port> connect to Hive Server on port Number-hiveconf x=y Use the To set Hive/hadoop configuration variables. Hive command Line Example • Execute the specified SQL statement from the command line • $HIVE _home/bin/hive-e ' Select A.col from Tab1 a ' • Executes the specified SQL statement with the specified HIVE environment variable • $HIVE _home/bin/hiv E-e ' Select A.col from Tab1 a '-hiveconf hive.exec.scratchdir=/home/my/hive_scratch-hiveconf mapred.reduce.tasks=32 to sink The default mode executes the specified SQL statement and exports the execution results to the specified file hive_home/bin/hive -e ' select A.col from Tab1 a ' > A.txt Execute SQL file in noninteractive mode hive_home/ Bin/hive-f/home/my/hive-script.sql Executes the initialization SQL file hive_home/bin/hive-i/home/my/hive-init.sql before entering interactive mode Hive Interactive shell Command When the command $HIVE _home/bin/hive runs without the-E/-F option, HIVE enters interactive mode • Ends the command line with (;) Colon
*command * |
Description |
Quit |
Exit command Line |
Set <key>=<value> |
Setting parameters |
Set-v |
Print out all hive-supported commands |
*command * |
Description |
Add FILE <value> <value>* |
Add a file to the resource list. |
List FILE |
List all resources that have been added |
List FILE <value>* |
View the added resources based on value |
! <cmd> |
Execute a shell command from hive Shell |
DFS <dfs command> |
command to execute DFS |
<query string> |
Execute query and output to standard output |
Part III: Log log hive using log4j to process logs • We can design the log level of HIVE with the following command • $HIVE _home/bin/hive-hiveconf hive.root.logger=info,console Hive.root.logger has info,debug, and so forth: resource hive Add resources hive can dynamically add resources, such as files • In general, we are adding files when interacting with hive • Actually using Hadoop Distributed cache to control the example add {File[s] | Jar[s] | Archive[s]} <filepath1> [<filepath2>]* list {File[s] | Jar[s] | Archive[s]} [<filepath1> <filepath2>:] delete {File[s] | Jar[s] | Archive[s]} [<filepath1> <filepath2> ...] turn from: http://sishuok.com/forum/blogPost/list/0/6228.html