Hadoop教程
HBase
Hive
Pig
Sqoop
Spark

Sqoop Where条件

您可以对使用" where"子句导入的数据进行限制。让我们导入state的cityByCountry表(第6列限于"Alaska")。
Sqoop MySQL where子句
The Sqoop语句写在下面
sqoop import \--connect "jdbc:mysql://localhost/training" \--username training-P \--table cityByCountry \--target-dir /user/where_clause \--where "state = 'Alaska'" \-m 1
输出如下所示
Sqoop MySQL where output
让我们列出使用mysql服务器的所有数据库一个"列表数据库"工具。
注意: 注意: 有关列表数据库的更多信息,请键入" $ sqoop help list-databases"。
$ sqoop list-databases--connect "jdbc:mysql://localhost"--username cloudera--password cloudera
类似地用于列表
$ sqoop list-tables--connect "jdbc:mysql://localhost/training"--username cloudera-P
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4