a. 创建一个数据库
create database word;
b. 建表
create external table word_data(line string) row format delimited fields terminated by '\n' stored as textfile location '/home/hadoop/worddata';
这里假设我们的数据存放在hadoop下,路径为:/home/hadoop/worddata,里面主要是一些单词文件,内容大概为:
+-------------------------+--+
| word_data.line |
+-------------------------+--+
| |
| hello man |
| what are you doing now |
| my running |
| hello |
| kevin |
| hi man |
| hadoop hive es |
| storm hive es |
|