测试环境搭建整套大数据系统(十七: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 \

相关推荐
程序新视界4 小时前
MySQL中什么是回表查询,如何避免和优化?
mysql
薛定谔的算法9 小时前
phoneGPT:构建专业领域的检索增强型智能问答系统
前端·数据库·后端
Databend10 小时前
Databend 亮相 RustChinaConf 2025,分享基于 Rust 构建商业化数仓平台的探索
数据库
得物技术11 小时前
破解gh-ost变更导致MySQL表膨胀之谜|得物技术
数据库·后端·mysql
Java水解11 小时前
【MySQL】从零开始学习MySQL:基础与安装指南
后端·mysql
Raymond运维15 小时前
MariaDB源码编译安装(二)
运维·数据库·mariadb
沢田纲吉16 小时前
🗄️ MySQL 表操作全面指南
数据库·后端·mysql
RestCloud1 天前
SQL Server到Hive:批处理ETL性能提升30%的实战经验
数据库·api
RestCloud1 天前
为什么说零代码 ETL 是未来趋势?
数据库·api
ClouGence1 天前
CloudCanal + Paimon + SelectDB 从 0 到 1 构建实时湖仓
数据库