Sqoop “eval”工具允许用户执行用户定义的查询,支持DDL或DML语句。
[dave@www.cndba.cn data]$ sqoop eval --connect jdbc:mysql://192.168.56.2:3306/employees --username root --password root --query "SELECT * FROM employees LIMIT 3"
2019-03-03 03:11:33,362 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
2019-03-03 03:11:33,486 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
2019-03-03 03:11:33,704 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
Sun Mar 03 03:11:34 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
---------------------------------------------------------------------------------
| emp_no | birth_date | first_name | last_name | gender | hire_date |
---------------------------------------------------------------------------------
| 10001 | 1953-09-02 | Georgi | Facello | M | 1986-06-26 |
| 10002 | 1964-06-02 | Bezalel | Simmel | F | 1985-11-21 |
| 10003 | 1959-12-03 | Parto | Bamford | M | 1986-08-28 |
---------------------------------------------------------------------------------
[dave@www.cndba.cn data]$
[dave@www.cndba.cn data]$ sqoop eval --connect jdbc:mysql://192.168.56.2:3306/employees --username root --password root --query "delete FROM employees"
2019-03-03 03:13:58,376 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
2019-03-03 03:13:58,523 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
2019-03-03 03:13:58,741 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
Sun Mar 03 03:13:59 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-03-03 03:14:20,803 INFO tool.EvalSqlTool: 300024 row(s) updated.
版权声明:本文为博主原创文章,未经博主允许不得转载。
- 上一篇:Sqoop 列出所有库和表
- 下一篇:HBase 概述