You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by Abraham Elmahrek <ab...@cloudera.com> on 2015/02/06 20:38:43 UTC

Review Request 30742: Sqoop2: Named constraints should be quoted

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30742/
-----------------------------------------------------------

Review request for Sqoop.


Bugs: sqoop-2087
    https://issues.apache.org/jira/browse/sqoop-2087


Repository: sqoop-sqoop2


Description
-------

commit 85acc1356e40b729f02adbbdd1e4f218c2f49cc0
Author: Abraham Elmahrek <ab...@apache.org>
Date:   Fri Feb 6 11:32:41 2015 -0800

    SQOOP-2087: Sqoop2: Named constraints should be quoted

:100644 100644 5121962... 95e3bb8... M  repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepoUtils.java
:100644 100644 d501a5d... acc802d... M  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaCreateQuery.java
:100644 100644 606fc68... ddc438d... M  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java


Diffs
-----

  repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepoUtils.java 5121962 
  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaCreateQuery.java d501a5d 
  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java 606fc68 

Diff: https://reviews.apache.org/r/30742/diff/


Testing
-------

Tested in derby:
CREATE TABLE "test" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT);
CREATE TABLE "testfk1" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT TESTFK FOREIGN KEY (fk) REFERENCES "test" (id));
CREATE TABLE "testfk2" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "TESTFK2" FOREIGN KEY (fk) REFERENCES "test" (id));
CREATE TABLE "testfk3" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "testfk3" FOREIGN KEY (fk) REFERENCES "test" (id));
ALTER TABLE "testfk1" DROP CONSTRAINT "TESTFK";
ALTER TABLE "testfk2" DROP CONSTRAINT TESTFK2;
ALTER TABLE "testfk3" DROP CONSTRAINT "testfk3";
DROP TABLE "test";
DROP TABLE "testfk1";
DROP TABLE "testfk2";
DROP TABLE "testfk3";

Tested with derby:
CREATE TABLE "test" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT);
CREATE TABLE "testfk1" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT TESTFK FOREIGN KEY (fk) REFERENCES "test" (id));
CREATE TABLE "testfk2" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "TESTFK2" FOREIGN KEY (fk) REFERENCES "test" (id));
CREATE TABLE "testfk3" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "testfk3" FOREIGN KEY (fk) REFERENCES "test" (id));
ALTER TABLE "testfk1" DROP CONSTRAINT TESTFK;
ALTER TABLE "testfk2" DROP CONSTRAINT "TESTFK2";
ALTER TABLE "testfk3" DROP CONSTRAINT "testfk3";
DROP TABLE "test";
DROP TABLE "testfk1";
DROP TABLE "testfk2";
DROP TABLE "testfk3";

This means upgrade will work because unquoted constraint names similar to quoted. Quoted makes guarantees though.

Could start Sqoop2 server.


Thanks,

Abraham Elmahrek


Re: Review Request 30742: Sqoop2: Named constraints should be quoted

Posted by Gwen Shapira <gs...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30742/#review71489
-----------------------------------------------------------

Ship it!


Ship It!

- Gwen Shapira


On Feb. 6, 2015, 7:38 p.m., Abraham Elmahrek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30742/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2015, 7:38 p.m.)
> 
> 
> Review request for Sqoop.
> 
> 
> Bugs: sqoop-2087
>     https://issues.apache.org/jira/browse/sqoop-2087
> 
> 
> Repository: sqoop-sqoop2
> 
> 
> Description
> -------
> 
> commit 85acc1356e40b729f02adbbdd1e4f218c2f49cc0
> Author: Abraham Elmahrek <ab...@apache.org>
> Date:   Fri Feb 6 11:32:41 2015 -0800
> 
>     SQOOP-2087: Sqoop2: Named constraints should be quoted
> 
> :100644 100644 5121962... 95e3bb8... M  repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepoUtils.java
> :100644 100644 d501a5d... acc802d... M  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaCreateQuery.java
> :100644 100644 606fc68... ddc438d... M  repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java
> 
> 
> Diffs
> -----
> 
>   repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepoUtils.java 5121962 
>   repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaCreateQuery.java d501a5d 
>   repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java 606fc68 
> 
> Diff: https://reviews.apache.org/r/30742/diff/
> 
> 
> Testing
> -------
> 
> Tested in derby:
> CREATE TABLE "test" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT);
> CREATE TABLE "testfk1" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT TESTFK FOREIGN KEY (fk) REFERENCES "test" (id));
> CREATE TABLE "testfk2" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "TESTFK2" FOREIGN KEY (fk) REFERENCES "test" (id));
> CREATE TABLE "testfk3" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "testfk3" FOREIGN KEY (fk) REFERENCES "test" (id));
> ALTER TABLE "testfk1" DROP CONSTRAINT "TESTFK";
> ALTER TABLE "testfk2" DROP CONSTRAINT TESTFK2;
> ALTER TABLE "testfk3" DROP CONSTRAINT "testfk3";
> DROP TABLE "test";
> DROP TABLE "testfk1";
> DROP TABLE "testfk2";
> DROP TABLE "testfk3";
> 
> Tested with derby:
> CREATE TABLE "test" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT);
> CREATE TABLE "testfk1" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT TESTFK FOREIGN KEY (fk) REFERENCES "test" (id));
> CREATE TABLE "testfk2" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "TESTFK2" FOREIGN KEY (fk) REFERENCES "test" (id));
> CREATE TABLE "testfk3" (id BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, fk BIGINT, CONSTRAINT "testfk3" FOREIGN KEY (fk) REFERENCES "test" (id));
> ALTER TABLE "testfk1" DROP CONSTRAINT TESTFK;
> ALTER TABLE "testfk2" DROP CONSTRAINT "TESTFK2";
> ALTER TABLE "testfk3" DROP CONSTRAINT "testfk3";
> DROP TABLE "test";
> DROP TABLE "testfk1";
> DROP TABLE "testfk2";
> DROP TABLE "testfk3";
> 
> This means upgrade will work because unquoted constraint names similar to quoted. Quoted makes guarantees though.
> 
> Could start Sqoop2 server.
> 
> 
> Thanks,
> 
> Abraham Elmahrek
> 
>