Small hive essays

1. First, building a database
create database if not exists hive; # create database
show databases; # View Hive contained in the database
show databases like 'h *.' ; # View Hive database to begin with h

2. Before the construction of the table to enter:
use hive (library name); switch to the hive database under #

3.建表
create table if not exists hive.stu(id int,name string)
row format delimited fields terminated by '\t'(文档通过table间隔);

4. The data file is loaded into the table
load data local inpath '/usr/local/hadoop/examples/stu.txt' overwrite into table lc;

5. If the query is NULL, then start the MySQL;
MySQL -u -p the root;
input Hive Character Database SET latin1 ALTER;

6.cd return the parent directory ..

Guess you like

Origin www.cnblogs.com/2205254761qq/p/11854249.html