首页 > 其他 > 详细

09Hive_ETL_数据分析

时间:2021-07-02 00:46:31      阅读:17      评论:0      收藏:0      [点我收藏+]
  1. 准备表

    1.创建原始表:video_ori

    点击查看代码
    create table video_ori(
        videoId string, 
        uploader string, 
        age int, 
        category array<string>, 
        length int, 
        views int, 
        rate float, 
        ratings int, 
        comments int,
        relatedId array<string>)
    row format delimited fields terminated by "\t"
    collection items terminated by "&"
    stored as textfile;

    2.创建原始表:user_ori

    点击查看代码
    reate table user_ori(
        uploader string,
        videos int,
        friends int)
    row format delimited 
    fields terminated by "\t" 
    stored as textfile;
    

    3.创建orc存储格式带snappy压缩的video_orc

    点击查看代码
    create table video_orc(
        videoId string, 
        uploader string, 
        age int, 
        category array<string>, 
        length int, 
        views int, 
        rate float, 
        ratings int, 
        comments int,
        relatedId array<string>)
    stored as orc
    tblproperties("orc.compress"="SNAPPY");

    4.创建orc存储格式带snappy压缩的user_orc

    点击查看代码
    create table video_user_orc(
        uploader string,
        videos int,
        friends int)
    row format delimited 
    fields terminated by "\t" 
    stored as orc
    tblproperties("orc.compress"="SNAPPY");
    

     

09Hive_ETL_数据分析

原文:https://www.cnblogs.com/HYBG-JXMD/p/14960646.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!