gpt4 book ai didi

sqoop - Sqoop 中 $conditions 的意义

转载 作者:行者123 更新时间:2023-12-02 17:17:52 27 4
gpt4 key购买 nike

sqoop import命令中$conditions子句的意义是什么?

select col1, col2 from test_table where \$CONDITIONS

最佳答案

Sqoop 通过继承 Hadoop 的并行性来执行高效的数据传输。

  • 帮助 Sqoop 将您的查询拆分成多个 block 并行传输,你 需要在查询的 where 子句中包含 $CONDITIONS 占位符。

  • 史库普 将自动用指定的生成条件替换此占位符 每个单独的任务应传输哪个数据片段。

  • 虽然你可以跳过 $CONDITIONS 通过使用 --num-mappers 1 参数强制 Sqoop 只运行一个作业 因此,这样的限制会对性能产生严重影响。

例如:-

If you run a parallel import, the map tasks will execute your query with different values substituted in for $CONDITIONS. one mapper may execute "select bla from foo WHERE (id >=0 AND id < 10000)", and the next mapper may execute "select bla from foo WHERE (id >= 10000 AND id < 20000)" and so on.

关于sqoop - Sqoop 中 $conditions 的意义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45186564/

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