测试环境搭建整套大数据系统(十七:mysql同步,字段类型映射错误问题)

问题描述

mysql表

hive表

其中 type是字符串类型,但是yarn上一直报错

number这个类是往int类型转才会使用到的

解决方法

在命令中增加参数

dart 复制代码
sqoop export \
  --connect "jdbc:mysql://?useUnicode=true&characterEncoding=UTF-8" \
  --username root \
  --password  \
  --table event_resource_statistics \
  --columns "create_time,type,quantity,used_space,size,sort" \
  --input-fields-terminated-by '\t' \
  --input-null-string '\\N' \
  --export-dir /hive/warehouse/parsed_local_probe_origin \
  --map-column-java create_time=String,type=String,quantity=Long,used_space=Long,size=String,sort=Integer \
  --verbose

增加--columns "create_time,type,quantity,used_space,size,sort"

--map-column-java create_time=String,type=String,quantity=Long,used_space=Long,size=String,sort=Integer \

相关推荐
Yeats_Liao26 分钟前
物联网平台MongoDB实战|(一)为什么选择MongoDB
数据库·物联网·mongodb
ZhengEnCi1 小时前
覆盖索引是什么:用借书和外卖看懂回表这件事
sql·mysql·postgresql
鹤落晴春1 小时前
MySQL日志梳理
运维·数据库·mysql
五彩小白2 小时前
Redis的过期删除和内存淘汰机制
数据库·redis·缓存
学长毕设2 小时前
基于SpringBoot 博物馆文物租赁及修复管理系统-附源码
大数据·数据库·spring boot
FungLeo2 小时前
FengCMS · PHP+MySQL 升级实录 · MySQL DDL不能回滚:模型字段结构操作的失败续做
android·mysql·php·工程实践·fengcms
apcipot_rain2 小时前
C++转Java日记(14)
数据库
隔窗听雨眠2 小时前
MySQL锁等待的定位方法与治理体系
mysql·锁机制·数据库运维
龙腾AI白云5 小时前
数字孪生与计算机视觉:让机器看懂现场
大数据·数据库·机器学习·知识图谱·pygame
千寻技术帮6 小时前
基于Spring Boot+Vue的农产品销售管理系统(源码+文档+数据库,附部署教程)
java·数据库·spring boot·后端·mysql·vue