Hive simple instructions for use, hive simple instructions for use
I usage:
Hive: Start hive
The command must end with a semicolon and tell hive to execute the command immediately, case insensitive.
Show tables; View tables
Desc tablename; view the columns in the table
Write SQL commands
Use udw;
Select user_id, action_id
From udw_ml_user_action
Where partition_date & gt; = 20150410
Distribute by user_id
Sort by user_id, action_id
Limit 10;
Execute SQL: hive-f test. SQL
Export Search Results: redirect to another format file: hive-f *. SQL> a.txt
II. data query commands
Order by: fully ordered, but only completed by a reducer. The efficiency of large-scale data sets is relatively low.
Sort by: generates a sorting file for each reducer.
Distribute by: determines the CER to which a specific row should be directed. For example, distribute by year ensures that all rows with the same year are eventually in the same CER partition.
Group by: group rows based on fields