标签:streaming 表示 本地 border 语言 导入数据 alter order 保存
mdl是数据操作类的语言,包括向数据表加载文件,写查询结果等操作
》从本地加载数据 LOAD DATA LOCAL INPATH ‘./examples/files/kv1.txt‘ OVERWRITE INTO TABLE [tableName]; 》从hdfs上加载数据 load data inpath ‘hdfs://192.168.177.124:9000/opt/hive/warehouse/student.txt‘ 》从其他表中查出数据并加载到其他表中 insert overwrite table student_1 partition(ds=‘20161219‘,country =‘B eiJing‘) select studentid,sex,address,email from student_3 where ad dress=‘BeiJing‘; 》创建表的时候从其他表中查出数据
hive> LOAD DATA LOCAL INPATH ‘./examples/files/kv1.txt‘ OVERWRITE INTO TABLE [tableName];
alter table student_1 add partition (ds=‘20161219‘,country =‘BeiJing‘);
hdfs上会创建给相应的文件目录
/opt/hive/warehouse/student_1/ds=20161219/country=BeiJing
hive> insert overwrite table student_1 partition(ds=‘20161219‘,country =‘BeiJing‘) select studentid,sex,address,email from student_3 where address=‘BeiJing‘;
load data inpath ‘hdfs://192.168.177.124:9000/opt/hive/warehouse/student.txt‘ into table tableName partition (address=‘BeiJing‘);
select ‘(name|age)?+‘ form [tableName]
select*from tableName where address=‘BeiJing‘
truncate table tableName;
drop table tableName;
delete from tableName t where t....
bin/hive -f [文件名] //这种是没有进入hive命令行语法
一般文件的名称后缀是‘.hsql 或者.q‘
source [文件名]; 例:source /home/wyp/Documents/test;//进入hive命令行后的语法
标签:streaming 表示 本地 border 语言 导入数据 alter order 保存
原文地址:http://www.cnblogs.com/zhangXingSheng/p/6223415.html