sqoop import --connect jdbc:mysql://192.168.160.130:3306/mydb --username root --password jqe6b6 --table news --hive-import --hive-table mydb.news --incremental append --check-column --last-value 0 --split-by news --target-dir /hdfs://zhaosai:9000/user/hive/warehouse/news
时间: 2023-08-05 09:09:05 浏览: 49
根据您提供的 Sqoop 命令,您需要指定一个有效的 `--check-column` 参数,以便 Sqoop 使用该列来确定哪些行是新的或更新的。在您的命令中,`--check-column` 参数后面缺少列名,因此导致了错误。
请在 `--check-column` 参数后面指定一个有效的列名,例如:
```
sqoop import --connect jdbc:mysql://192.168.160.130:3306/mydb --username root --password jqe6b6 --table news --hive-import --hive-table mydb.news --incremental append --check-column id --last-value 0 --split-by news --target-dir /hdfs://zhaosai:9000/user/hive/warehouse/news
```
在上面的命令中,我将 `--check-column` 参数的值设置为 `id`,因为在您的表结构中没有一个适合作为检查列的整数类型列或时间戳列。
请注意,如果您使用的是自定义查询而不是简单的表导入,则需要使用 `--query` 参数来指定查询语句,并在查询语句中包含 `--check-column` 和 `--split-by` 参数的值。
相关问题
bin/sqoop list-databases --connect jdbc:mysql://192.168.10.102:3306/ --username root --password 123456
This command lists all databases in the MySQL server running at IP address 192.168.10.102 on port 3306, using the root user with password 123456 to authenticate. The output will show the names of all databases available in the server.
sqoop export -connect jdbc:mysql://192.168.88.105:3306/mydb -username root -password 123456 -table my --export-dir 1.csv -m 1^C
这是一个使用Sqoop工具将Hadoop上的数据导入到MySQL数据库的命令。其中,-connect参数指定了MySQL的连接地址,-username和-password参数指定了连接MySQL所需的用户名和密码,-table参数指定了要将数据导入到MySQL的哪个表中,而--export-dir参数指定了要导入的数据所在的目录。最后的-m参数指定了使用的并发任务数,这里是1。如果您有任何关于Sqoop的问题,可以继续问我。