sqoop导出hive表到mysql中
2016-07-18 20:06
579 查看
一、sqoop导出hive表到mysql中:
实现语句:
sqoop export --connect jdbc:mysql://ip:3306/application?characterEncoding=utf-8 --username root --password secret_password
--table uv_info --export-dir /user/hive/warehouse/origin_ennenergy_energytrade.db/m_bd_t_chang_status_h --input-fields-terminated-by '\t'
二、sqoop导出[b]mysql表到hive中:[/b]
将mysql中的表数据导入到hive中:可以自动创建sqoop create-hive-table --connect jdbc:mysql://ip:3306/application --table uv_info --username root --password secret_password --hive-table origin_ennenergy_transport.uv_info
-m 1是没有主键时加的,有主键怎么搞我也没整呢sqoop import --connect jdbc:mysql://ip:3306/application --username root --password secret_password --table uv_info --hive-import --hive-table origin_ennenergy_transport.uv_info -m 1 --fields-terminated-by "\0001";
实现语句:
sqoop export --connect jdbc:mysql://ip:3306/application?characterEncoding=utf-8 --username root --password secret_password
--table uv_info --export-dir /user/hive/warehouse/origin_ennenergy_energytrade.db/m_bd_t_chang_status_h --input-fields-terminated-by '\t'
二、sqoop导出[b]mysql表到hive中:[/b]
将mysql中的表数据导入到hive中:可以自动创建sqoop create-hive-table --connect jdbc:mysql://ip:3306/application --table uv_info --username root --password secret_password --hive-table origin_ennenergy_transport.uv_info
-m 1是没有主键时加的,有主键怎么搞我也没整呢sqoop import --connect jdbc:mysql://ip:3306/application --username root --password secret_password --table uv_info --hive-import --hive-table origin_ennenergy_transport.uv_info -m 1 --fields-terminated-by "\0001";
相关文章推荐
- ola.hallengren的SQL Server维护脚本
- sqlplus copy
- mysql维护和优化中需要做什么
- 免安装Oracle客户端使用PLSQL Developer连接Oracle
- SQL truncate 、delete与drop区别
- postgresql中间件pgoneproxy支持冷热数据分离查询
- 高性能Mysql主从架构的复制原理及配置详解(转)
- set serveroutput on 在PL/SQL中输出内容
- _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':问题的解决
- PLSQL Developer实现数据库间表结构和数据对比和同步
- 运维角度浅谈MySQL数据库优化
- 关于rst.Open Trim$(SQL), cnn, adOpenKeyset, adLockOptimistic
- PL/SQL Developer 如何显示行号
- MySQL Cluster导入数据表时报错:Got error 708 'No more attribute metadata records (increase MaxNoOfAttributes)' from NDBCLUSTER
- service mysqld start 报错:service mysqld start 报错 090517 13:34:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 090Can't open the mysql.plugin table. Please run mysql
- 【SQL Performance】实时SQL监控功能(Real-Time SQL Monitoring)
- MySQL server has gone away报错原因分析
- 64位win中用PLSQL Developer连接64位Oracle数据库
- The MySQL server is running with the --read-only option so it cannot execute this statement
- Oracle SQL Developer工具常用配置