当前位置: 首页 > news >正文

[sqoop]hive导入mysql,其中mysql的列存在默认值列

一、思路

直接在hive表中去掉有默认值的了列,在sqoop导入时,指定非默认值列即可,

二、具体

mysql的表

hive的表 

create table dwd.dwd_hk_rcp_literature(id string,literature_no string,authors string,article_title string,source_title string,publication_date string,publication_year string,volume string,issue string,price string,created_at string,--插入时间
--     updated_at string,--这个字段不管
--     delete_status string,--有默认值abstract string
)
row format delimited
fields terminated by "\001"
;

sqoop导入

sqoop export \
--connect jdbc:mysql://ip:端口号/yly_ms_dev \
--username 用户名 \
--password 密码 \
--table hk_rcp_literature \
--columns "id,literature_no,author,article_title,source_title,publication_date,publication_year,volume,issue,price,created_at,abstracts" \
--export-dir /user/hive/warehouse/dwd.db/dwd_hk_rcp_literature \
--input-fields-terminated-by "\001"

http://www.lryc.cn/news/192701.html

相关文章:

  • Stream流中的常用方法(forEach,filter,map,count,limit,skip,concat)和Stream流的特点
  • 2023大联盟2比赛总结
  • Flutter笔记:电商中文货币显示插件Money Display
  • 腾讯云上创建 对象存储cos
  • 微信小程序生成海报
  • stm32学习笔记:EXIT中断
  • css 块元素、行内元素、行内块元素相互转换
  • 【JUC】多线程基础概述
  • Git 回退代码的两种方法对比
  • Avalonia常用小控件Charts
  • 【Hugging Face】管理 huggingface_hub 缓存系统
  • Python学习基础笔记六十六——对象的方法
  • 建立一个新的高阶数学教授模式,知其然,知其用,知其之所以然,知其所以然
  • AtCoder ABC324G 启发式合并
  • SpringBootCMS漏洞复现分析
  • iOS- flutter flavor 多环境Configurations配置
  • 【PyTorchTensorBoard实战】GPU与CPU的计算速度对比(附代码)
  • npm 常用指令总结
  • 布朗大学发现GPT-4存在新问题,可通过非常见语言绕过限制
  • ESP32网络编程-TCP客户端数据传输
  • 微信小程序入门级
  • 博客文档续更(二)
  • Centos切换yum源
  • milvus和相似度检索
  • 龙迅LT7911UXC 是一款高性能TYPE-C/DP/EDP转换四端口MIPI/LVDS的芯片,还支持图像处理
  • TOR(Top of Rack)
  • 使用asp.net core web api创建web后台,并连接和使用Sql Server数据库
  • LaTeX 公式与表格绘制技巧
  • Spring Cloud--Nacos+@RefreshScope实现配置的动态更新
  • Elasticsearch安装