我试图写一个sqoop工作,以达到以下要求。我有一个xyz表,在这个表中,每天可能有大约1 mil的新记录被创建,0.5 mil的更新。我将有一天结束sqoop的工作,这应该得到从xyz到hdfs的增量数据,也得到更新的记录,并与hdfs同步。我很乐意执行第1点,但无法为第2点找到可行的解决方案。请帮忙!!!!谢谢,拉格胡
gdrx4gfi1#
对于这个特定的场景,您可以在需要的地方执行增量sqooplastmodified–check column last\ U modified\ U col–last value“2014-10-03 15:29:48.66”请参考下面的示例查询
sqoop job –create incr1 — import –connect jdbc:mysql://192.168.199.137/testdb123 –username testdb123 –password testdb123 –table Paper_STAGE –incremental lastmodified –check-column last_modified_col –last-value “2014-10-03 15:29:48.66″ –split-by id –hive-table paper_stage –hive-import
hive和hdfs是可选的,您可以在任何地方选择它们中的任何一个。
1条答案
按热度按时间gdrx4gfi1#
对于这个特定的场景,您可以在需要的地方执行增量sqoop
lastmodified–check column last\ U modified\ U col–last value“2014-10-03 15:29:48.66”
请参考下面的示例查询
hive和hdfs是可选的,您可以在任何地方选择它们中的任何一个。