You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Raghav Gautam <rk...@qubole.com> on 2012/10/04 03:26:27 UTC
Problem using upsert with MySQL
Hi,
I tried using upsert mode with MySQL and received the following error. Is
it not supported yet ?
Error:
ERROR tool.ExportTool: Error during export: Mixed update/insert is not
supported against the target database yet
Command:
sqoop --connect jdbc:mysql://localhost/test --username root --hive-table
test --table test2 --update-key=id --update-mode=allowinsert
With Regards,
Raghav.
Re: Problem using upsert with MySQL
Posted by Jarek Jarcec Cecho <ja...@apache.org>.
Hi Raghav,
I've look into the code myself and I'm afraid that MySQL connector is really not supporting upsert at the moment. Please take a look at file org.apache.sqoop.manager.MySQLManager if you're interested.
I believe that adding upsert functionality to MySQL connector should not be a big deal as the database is already supporting it. Would you mind filling a JIRA about that on https://issues.apache.org/jira/browse/SQOOP ?
Jarcec
On Thu, Oct 04, 2012 at 09:38:34AM +0530, Raghav Gautam wrote:
> Hi Kathleen,
>
> I was doing sqoop export. I have a wrapper script which fires the actual
> command. The option that was used was --update-mode allowinsert and the
> database was mysql resulting in:
> ERROR tool.ExportTool: Error during export: Mixed update/insert is
> not supported against the target database yet
>
> Without the --update-mode I get the rows appended as expected to the
> destination table.
>
> BTW, any idea which code commit added the feature for mysql - I would love
> to look at the code myself.
>
> Thanks,
> Raghav.
>
>
> On Thu, Oct 4, 2012 at 7:44 AM, Kathleen Ting <ka...@apache.org> wrote:
>
> > Hi Raghav, I can't tell if you're doing a Sqoop export or import as
> > neither was specified in the command?
> >
> > Also, can you try with
> >
> > --update-mode allowinsert
> >
> > (i.e. without the '=' sign)?
> >
> > e.g. sqoop export --connect jdbc:mysql://localhost/test --username
> > root --hive-table test --table test2 --update-key=id --update-mode
> > allowinsert
> >
> > Regards, Kathleen
> >
> > On Wed, Oct 3, 2012 at 6:26 PM, Raghav Gautam <rk...@qubole.com> wrote:
> > > Hi,
> > >
> > > I tried using upsert mode with MySQL and received the following error.
> > Is it
> > > not supported yet ?
> > >
> > > Error:
> > > ERROR tool.ExportTool: Error during export: Mixed update/insert is not
> > > supported against the target database yet
> > >
> > > Command:
> > > sqoop --connect jdbc:mysql://localhost/test --username root --hive-table
> > > test --table test2 --update-key=id --update-mode=allowinsert
> > >
> > > With Regards,
> > > Raghav.
> >
Re: Problem using upsert with MySQL
Posted by Raghav Gautam <rk...@qubole.com>.
Hi Kathleen,
I was doing sqoop export. I have a wrapper script which fires the actual
command. The option that was used was --update-mode allowinsert and the
database was mysql resulting in:
ERROR tool.ExportTool: Error during export: Mixed update/insert is
not supported against the target database yet
Without the --update-mode I get the rows appended as expected to the
destination table.
BTW, any idea which code commit added the feature for mysql - I would love
to look at the code myself.
Thanks,
Raghav.
On Thu, Oct 4, 2012 at 7:44 AM, Kathleen Ting <ka...@apache.org> wrote:
> Hi Raghav, I can't tell if you're doing a Sqoop export or import as
> neither was specified in the command?
>
> Also, can you try with
>
> --update-mode allowinsert
>
> (i.e. without the '=' sign)?
>
> e.g. sqoop export --connect jdbc:mysql://localhost/test --username
> root --hive-table test --table test2 --update-key=id --update-mode
> allowinsert
>
> Regards, Kathleen
>
> On Wed, Oct 3, 2012 at 6:26 PM, Raghav Gautam <rk...@qubole.com> wrote:
> > Hi,
> >
> > I tried using upsert mode with MySQL and received the following error.
> Is it
> > not supported yet ?
> >
> > Error:
> > ERROR tool.ExportTool: Error during export: Mixed update/insert is not
> > supported against the target database yet
> >
> > Command:
> > sqoop --connect jdbc:mysql://localhost/test --username root --hive-table
> > test --table test2 --update-key=id --update-mode=allowinsert
> >
> > With Regards,
> > Raghav.
>
Re: Problem using upsert with MySQL
Posted by Kathleen Ting <ka...@apache.org>.
Hi Raghav, I can't tell if you're doing a Sqoop export or import as
neither was specified in the command?
Also, can you try with
--update-mode allowinsert
(i.e. without the '=' sign)?
e.g. sqoop export --connect jdbc:mysql://localhost/test --username
root --hive-table test --table test2 --update-key=id --update-mode
allowinsert
Regards, Kathleen
On Wed, Oct 3, 2012 at 6:26 PM, Raghav Gautam <rk...@qubole.com> wrote:
> Hi,
>
> I tried using upsert mode with MySQL and received the following error. Is it
> not supported yet ?
>
> Error:
> ERROR tool.ExportTool: Error during export: Mixed update/insert is not
> supported against the target database yet
>
> Command:
> sqoop --connect jdbc:mysql://localhost/test --username root --hive-table
> test --table test2 --update-key=id --update-mode=allowinsert
>
> With Regards,
> Raghav.