一、项目实战
1.链接hive库
创建数据库
create database if not exists text;
use text;
创建表
create table if not exists fwzh(
time string comment'消息时间',
output_name string comment'发件人呢称',
output_no string comment'发件人账号',
output_sex string comment'性别',
output_ip string comment'发件人IP',
output_system string comment'发件人系统',
output_phone string comment'发件人手机型号',
output_net string comment'发件人网络制式',
output_gps string comment'发件人GPS',
input_name string comment'收件人称',
input_ip string comment'收件人IP',
input_no string comment'收件人账号',
input_system string comment'收件人系统',
input_phone string comment'收件人手机型号',
input_net string comment'收件人网络制式',
input_gps string comment'收件人GPS',
input_sex string comment'收件人性别',
news_type string comment'消息类型',
distance string comment'双方距离',
news string comment'消息');
导入本地数据
load data local inpath '/export/data/chat_data-10W.csv' into table fwzh;
ETL实现,消除多余空格
create table text.etl as
select
*,
substr(time,0,10) as dayinfo, substr(time,12,2) as hourinfo,
split(output_gps,",")[0] as sender_lng, split(output_gps,",")[1] as sender_lat
from text.fwzh
where length(output_gps) > 0 ;
最后根据自己的需求用相关MySQL语言进行
二、FineBI可视化