// 创建数据库并导入数据
1. create database {database_name};
2. use {database_name};
3. create table docs(line string);
4. load data inpath '/training/{student_name}/inceptor_data/wordcount' into table docs;
//创建结果表
create table wc(word string, totalword int);
// wordcount统计
from (select explode(split(line, ' ')) as word from docs) w
insert into table wc
select word, count(1) as totalword
group by word
order by word;
// 查看分析结果
select * from wc;
// 创建外表
create external table ext_table(rowkey string, num int, country int, rd string) row format delimited fields terminated by ',' location '/images/inceptor_data';
//创建ORC事务表
// 设置开启事务
1. set transaction.type=inceptor;
// 设置PLSQL编译器不检查语义
2. set plsql.compile.dml.check.semantic=fal

这篇博客详细介绍了在Hive中进行数据处理的步骤,包括创建数据库、导入数据、执行wordcount统计、创建外部表和ORC事务表。还涉及到单值分区表和ORC分区分桶表的创建,展示了Hive在大数据处理中的应用。
最低0.47元/天 解锁文章
1872

被折叠的 条评论
为什么被折叠?



