sqoop使用
来源:互联网 发布:国债期货 知乎 编辑:程序博客网 时间:2024/05/22 03:06
list-databases 列出数据库
sqoop list-databases –connect jdbc:oracle:thin:@172.21.202.4:1521:TJZHCSDEV –username tjzhcs –password tjzhcslist-tables 列出某数据库下的表
sqoop list-tables–connect jdbc:oracle:thin:@172.21.202.4:1521:TJZHCSDEV –username tjzhcs –password tjzhcseval 可以快速地使用SQL语句对关系数据库进行操作,这可以使得在使用import这种工具进行数据导入的时候,可以预先了解相关的SQL语句是否正确,并能将结果显示在控制台
sqoop eval –connect jdbc:oracle:thin:@172.21.202.4:1521:TJZHCSDEV –username tjzhcs –password tjzhcs -e “select * from b_code”create-hive-table 生成与关系数据库表的表结构对应的HIVE表
sqoop create-hive-table –connect jdbc:oracle:thin:@172.21.202.4:1521:TJZHCSDEV –username tjzhcs –password tjzhcs -table B_CODE -hive-table h_b_code(注:oracle导入的时候表名需要使用大写!!!)导入oracle表到hive中
sqoop import –connect jdbc:oracle:thin:@172.21.202.4:1521:TJZHCSDEV –username tjzhcs –password tjzhcs –table B_CODE –hive-table h_b_code –hive-import
Hive arguments:Argument Description
--hive-home <dir> Override $HIVE_HOME
--hive-import Import tables into Hive (Uses Hive’s default delimiters if none are set.)
--hive-overwrite Overwrite existing data in the Hive table.
--create-hive-table If set, then the job will fail if the target hive
table exits. By default this property is false.
--hive-table <table-name> Sets the table name to use when importing to Hive.
--hive-drop-import-delims Drops \n, \r, and \01 from string fields when importing to Hive.
--hive-delims-replacement Replace \n, \r, and \01 from string fields with user defined string when importing to Hive.
--hive-partition-key Name of a hive field to partition are sharded on
--hive-partition-value <v> String-value that serves as partition key for this imported into hive in this job.
--map-column-hive <map> Override default mapping from SQL type to Hive type for configured columns.sqoop list-databases –connect jdbc:mysql://172.21.80.123:3306/ –username root –password 1234
sqoop import --connect jdbc:mysql://172.21.80.123:3306/hadoop --username root --password 1234 --table lsemp --hbase-table lsemp --hbase-create-table --hbase-row-key empno --column-family infoHBase arguments:```Argument Description--column-family <family> Sets the target column family for the import--hbase-create-table If specified, create missing HBase tables--hbase-row-key <col> Specifies which input column to use as the row keyIn case, if input table contains compositekey, then <col> must be in the form of acomma-separated list of composite keyattributes--hbase-table <table-name> Specifies an HBase table to use as the target instead of HDFS--hbase-bulkload Enables bulk loading
mysql相关1.执行sqlsqoop eval --connect jdbc:mysql://localhost:3306/hive --username root --password 123456 -e 'show tables'2.列出库sqoop list-databases --connect jdbc:mysql://localhost:3306/ --username root --password 1234563.导入mysql数据到hivesqoop import --connect jdbc:mysql://localhost:3306/test --username root --password 123456 --table student --hive-table student --hive-import --hive-database test4.导出hive数据到mysqlsqoop export --connect jdbc:mysql://localhost:3306/test --username root --password 123456 --table word_count -export-dir /user/hive/warehouse/test.db/word_count --input-fields-terminated-by '\001'
- [Sqoop]Sqoop使用
- sqoop使用
- sqoop使用
- sqoop使用
- sqoop使用
- Sqoop使用
- sqoop 使用心得(sqoop增量倒入)
- sqoop使用心得~~~
- sqoop 安装及使用
- sqoop 的使用
- sqoop的使用
- sqoop的使用
- sqoop的安装使用
- Sqoop使用和简介
- sqoop的使用
- Sqoop使用整理
- Apache Sqoop使用介绍
- sqoop使用记录
- 马云现身芒果TV 对极米无屏电视赞不绝口
- 机器学习扫盲---常见学习效果指标说明(并附基于sklearn库计算AUC)
- 开放Cortex-M0处理器,ARM让人人都能设计芯片
- linux基础(二)
- 远程访问Jupyter Notebook应用(Linux虚拟机)
- sqoop使用
- 12306开售春运火车票 手机管家:谨防四大陷阱
- 壹号农场获徽瑾创投数千万投资 布局高科技突围农业电商
- “南通”走出QQ邮箱 微信后 第四个行业第一是?
- 30个项目扎堆路演 腾讯众创空间创业营“学前班”深圳开学
- 关于Win7 x64下过TP保护(应用层)
- 解决eclipse导出javadoc时的“错误: 编码GBK的不可映射字符”问题
- Linux系统学习之初
- 手机连电脑中双重木马 腾讯两管家联手查杀