ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

实战

2022-07-01 20:04:52  阅读:212  来源: 互联网

标签:实战 COMMENT string -- timestamp ods time


 

 

 

 ods建表

drop table itcast_ods.web_acc_info;
-- auto-generated definition
CREATE TABLE itcast_ods.web_acc_info
(
    id                           string comment '主键' ,
    create_date_time             TIMESTAMP                                 COMMENT '数据创建时间',
    session_id                   string  COMMENT '七陌sessionId',
    sid                          string  COMMENT '访客id',
    create_time                  timestamp                                  COMMENT '会话创建时间',
    seo_source                   string  COMMENT '搜索来源',
    seo_keywords                 string  COMMENT '关键字',
    ip                           string  COMMENT 'IP地址',
    area                         string  COMMENT '地域',
    country                      string  COMMENT '所在国家',
    province                     string  COMMENT '省',
    city                         string  COMMENT '城市',
    origin_channel               string  COMMENT '投放渠道',


    `user`                         string  ,
    manual_time                  timestamp                                  COMMENT '人工开始时间',
    begin_time                   timestamp                                  COMMENT '坐席领取时间 ',
    end_time                     timestamp                                  COMMENT '会话结束时间',



    last_customer_msg_time_stamp timestamp                                  COMMENT '客户最后一条消息的时间',
    last_agent_msg_time_stamp    timestamp                                  COMMENT '坐席最后一下回复的时间',
    reply_msg_count              INT                          COMMENT '客服回复消息数',
    msg_count                    INT                          COMMENT '客户发送消息数',
    browser_name                 string    COMMENT '浏览器名称',
    os_info                      string    COMMENT '系统名称'
)
    COMMENT '访问咨询表'
    row format delimited fields terminated by '\t' stored as orc tblproperties ('orc.compress'='ZLIB');
View Code

 

 

#将mysql 中第一张表导入hive 中的ods层
/usr/bin/sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" \
--connect 'jdbc:mysql://106.75.33.59:3306/nev?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true' \#mysql中的数据库名
--username itcast_edu_stu \
--password itcast_edu_stu \
--query "select * from web_chat_ems_2019_07 where 1=1 and \$CONDITIONS" \#mysql中的表名
--hcatalog-database itcast_ods \#hive中的数据库名
--hcatalog-table web_acc_info \#hive数据库中ods层的表名
-m 1

 

***关键 ods层建表语句 表的字段数和字段名 都要完全和mysql中相同 随便加个主键就会sqoop导入失败

 

标签:实战,COMMENT,string,--,timestamp,ods,time
来源: https://www.cnblogs.com/q1231/p/16435788.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有