sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keegan Witt (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SQOOP-1403) Upsert export for SQL Server
Date Wed, 27 Aug 2014 20:37:01 GMT

     [ https://issues.apache.org/jira/browse/SQOOP-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Keegan Witt updated SQOOP-1403:
-------------------------------

    Attachment: SQOOP-1403_with_conditional_upsert.patch
                SQOOP-1403.patch

Thank you both for your comments, they were very helpful.  Here's an example of the syntax
I ultimately went with (in case any SQL Server guru wants to tell me how wrong it is):
{code:sql}
MERGE INTO [testTable] AS _target USING ( VALUES ( 1, 2 ) ) AS _source ( k, v )
ON _target.k = _source.k
WHEN MATCHED THEN UPDATE SET _target.v = _source.v
WHEN NOT MATCHED THEN INSERT ( k, v ) VALUES ( _source.k, _source.v );
{code}
I've attached two patches; one that includes the conditional merge functionality, and one
that doesn't.  Feel free to merge whichever you are more comfortable with.

> Upsert export for SQL Server
> ----------------------------
>
>                 Key: SQOOP-1403
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1403
>             Project: Sqoop
>          Issue Type: New Feature
>          Components: connectors/sqlserver
>            Reporter: Keegan Witt
>            Assignee: Keegan Witt
>         Attachments: SQOOP-1403.patch, SQOOP-1403_non_func.patch, SQOOP-1403_with_conditional_upsert.patch
>
>
> Same as has been done in SQOOP-327 and SQOOP-621 (and requested in SQOOP-1270), but for
SQL Server.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message