sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkat Ranganathan <vranganat...@hortonworks.com>
Subject Re: Sqoop Incremental Import with lastmodified mode giving Duplicate rows for updated rows
Date Mon, 06 Oct 2014 17:05:06 GMT
Hi Nirmal

hdp connector for TD is a HDP specific work.  Please use the vendor forums
for this.
Last modified is not supported as specified in Sqoop.   The HDP
documentation has an example of doing this using queries.  Please look at
the documentation



On Mon, Oct 6, 2014 at 5:29 AM, Nirmal Kumar <nirmal.kumar@impetus.co.in>

>  Hi All,
>  I’m trying to do an Incremental Import using Sqoop from Teradata to Hive
> tables.
>  I’m using:
> -Apache Hadoop 2.4.0
> -Apache Hive 0.13.1
> -Apache Sqoop 1.4.4
> -hdp-connector-for-teradata-
> -Teradata
>  *From Sqoop documentation:*
> *An alternate table update strategy supported by Sqoop is called
> lastmodified mode. You should use this when rows of the source table may be
> updated, and each such update will set the value of a last-modified column
> to the current timestamp. Rows where the check column holds a timestamp
> more recent than the timestamp specified with –last-value are imported.*
>  I followed the below steps:
>  *STEP 1*: One time activity
> I’m doing a full import of the table to hive table.
>  *STEP 2*: One time activity
> Created a Sqoob Job for incremental import
> sqoop job –create incr1 — import –connection-manager
> org.apache.sqoop.teradata.TeradataConnManager –connect jdbc:teradata://
> –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
>  *STEP 3*: This will be done on timely basis from any Scheduler OR Oozie
> Executing the Sqoob Job for incremental import everytime I need the
> updated rows/newly added rows.
> sqoop job –exec incr1
>  The source table has a “unique primary key” and “last modified column”
> with current timestamp.
> The newly added rows though are working fine and getting imported but for
> the updated rows I’m getting duplicate rows.
> Sqoop is not updating the updated rows but adding a new one with same Id
> and new current timestamp.
>  Is this something which is currently not supported in Sqoop as of now ?
> This is since I found these:
> http://stackoverflow.com/questions/19093417/sqoop-import-lastmodified-gives-duplicate-records-it-doesnt-merger
> http://grokbase.com/p/cloudera/cdh-user/13a4n03jrh/sqoop-import-lastmodified-gives-duplicate-records-merger-does-not-happen
> https://groups.google.com/a/cloudera.org/forum/#!topic/cdh-user/xAbXEduvahU
> https://issues.cloudera.org/browse/DISTRO-464
>  Is there a way to avoid the duplicate rows for the updated rows and get
> a merged updated row for each updated row in the Source table?
> Kindly advise me any alternatives to handle this.
>  Thanks,
> -Nirmal
> ------------------------------
> NOTE: This message may contain information that is confidential,
> proprietary, privileged or otherwise protected by law. The message is
> intended solely for the named addressee. If received in error, please
> destroy and notify the sender. Any use of this email is prohibited when
> received in error. Impetus does not represent, warrant and/or guarantee,
> that the integrity of this communication has been maintained nor that the
> communication is free of errors, virus, interception or interference.

NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

View raw message