使用文件在hadoop上创建表:
创建目录:
hadoop fs -mkdir /tmp/test/wenda_users
将本地文件上传到目录
hadoop fs -put 本地文件名 HDFS目录名
eg:hadoop fs -put wenda_users.txt /tmp/test/wenda_users
查看目录:
hadoop fs -ls /tmp/test/
创建外部表:
注:外部表指的是只在hive上创建表结构,指向文件
create external table tmp_表名
(c1 string,//表结构字段
)
row format delimited fields terminated by ‘\t’
location ‘/tmp/test/’;