赞
踩
// 创建数据库并导入数据
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=false;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。