欢迎投稿

今日深度:

hive 加载数据,

hive 加载数据,


##方式一 create + loadcreate [external] table table_name(col1_name col1_type,...coln_name coln_type)row format delimited fields terminated by '\t';
//load加载数据load data [local] inpth '本地文件(linux)/HDFS' [overwrite] into table table_name;
##方式二 like + load##复制表结构create table tableB like tableA; //首先必须要有tableA
//load加载数据load data [local] inpth '本地文件(linux)/HDFS' [overwrite] into table table_name;
##方式三 as 创建表的同时加载数据create table tableB row format delimited filelds termianted by ','as select * from tableA; //首先必须要有tableA
create table emp_as row format delimited fields terminated by ',' as select empno,empname,salary from emp_part1;
*** ##方式四 create + insert1.创建表create table emp_insert(id int,name string,job string,salary float)row format delimited fields terminated by ',';
2.insert into 加载数据insert into table emp_insert select empno,empname,empjob,salary from emp_part1 where day='20170308' and hour='14';overwrite/into 二者不能连着写 要么是overwrite 要么是into,推荐用overwrite

www.htsjk.Com true http://www.htsjk.com/hive/37020.html NewsArticle hive 加载数据, ## 方式一 create + load create [external] table table_name(col1_name col1_type,...coln_name coln_type)row format delimited fields terminated by '\t'; //load加载数据load data [local] inpth '本地文件(linux)/HDF...
相关文章
    暂无相关文章
评论暂时关闭