gpt4 book ai didi

mysql - sqoop 增量导入 :Import failed: --merge-key or --append is required when using --incremental lastmodified and the output directory exists

转载 作者:行者123 更新时间:2023-11-29 07:20:29 26 4
gpt4 key购买 nike

我已经使用 sqoop 将 mySql 数据库表导入到 hdfs。数据库每天更新。现在我尝试使用 sqoop 作为

增量导入数据
sqoop import --connect jdbc:mysql://127.0.0.1/crawl_data_stats --username root --password password --table scraped_comments -m 1 --as-parquetfile --target-dir /databases/crawl_data_stats/scraped_comments --check-column timestamp --incremental lastmodified --last-value '2019-05-16 13:06:31' --driver com.mysql.jdbc.Driver

但是导入失败,输出如下:

19/06/13 12:51:28 INFO manager.SqlManager: Using default fetchSize of 1000  
19/06/13 12:51:28 INFO tool.CodeGenTool: Beginning code generation
19/06/13 12:51:28 INFO tool.CodeGenTool: Will generate java class as codegen_scraped_comments
Thu Jun 13 12:51:28 IST 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.
19/06/13 12:51:29 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM scraped_comments AS t WHERE 1=0
19/06/13 12:51:29 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM scraped_comments AS t WHERE 1=0
19/06/13 12:51:29 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/hadoop
Note: /tmp/sqoop-root/compile/8ccf132bb0ce002d14d2afeb75f85cf9/codegen_scraped_comments.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
19/06/13 12:51:31 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-root/compile/8ccf132bb0ce002d14d2afeb75f85cf9/codegen_scraped_comments.jar
19/06/13 12:51:32 ERROR tool.ImportTool: Import failed: --merge-key or --append is required when using --incremental lastmodified and the output directory exists.

最佳答案

向 sqoop 导入命令添加 merge-key 选项时错误消失了

sqoop import --connect jdbc:mysql://127.0.0.1/crawl_data_stats --username root --password password --table scraped_metadata -m 1 --as-parquetfile --target-dir /databases/crawl_data_stats/scraped_metadata --check-column timestamp --incremental lastmodified --last-value '2019-05-16 13:06:31' --driver com.mysql.jdbc.Driver --merge-key id

关于mysql - sqoop 增量导入 :Import failed: --merge-key or --append is required when using --incremental lastmodified and the output directory exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56576544/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com