运行sqoop命令时$ CONDITIONS的重要性

时间:2014-03-12 15:28:28

标签: sqoop

每个sqoop导入查询中$ CONDITIONS的重要性是什么?

例如:

select col1, col2 from test_table where \$CONDITIONS

如果我需要在查询中放置自己的条件并且它有效,该怎么办?

2 个答案:

答案 0 :(得分:1)

Sqoop User GuideApache Sqoop cookbook解释了重要性。简而言之,Sqoop需要在查询中使用占位符来填充生成的切片以启用并行导入。

答案 1 :(得分:0)

It will act as a place holder where sqoop replaces it to make the query works parallel. It is must to put $CONDTIONS when you are importing query results. Still you can place your condition as below,

Select col1,col2 from table where $CONDITIONS and "your condtion"

Note: you can directly see in stack trace what the condition sqoop places here at $CONDITIONS. Eg. The first thing you can see is the condition "where 1=0" to fetch the metadata or schema from source table.

相关问题