【发布时间】:2015-10-23 12:26:09
【问题描述】:
您好,我有一个文档上传到名为 Data 的 Hive 表中,示例行如下:
He is a good boy and but his brother is a bad boy.
He is a naughty boy.
表的架构是:
create table Data(
document_data STRING)
row format delimited
fields terminated by '\n'
stored as textfile;
我想编写一个查询,只计算单词 boy 和 naughty` 的出现次数,然后输出它们:
boy 3
naughty 1
【问题讨论】:
-
我们可以知道你的蜂巢表的结构吗?
-
创建表数据(document_data STRING) 以'\n' 结尾的行格式分隔字段存储为文本文件;
标签: hadoop mapreduce hive hiveql