You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Dmytro Sen <ds...@hortonworks.com> on 2015/08/20 19:05:20 UTC

Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

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

Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.


Bugs: AMBARI-12836
    https://issues.apache.org/jira/browse/AMBARI-12836


Repository: ambari


Description
-------

I think that the alterColumn in the upgrade catalog may not be working.
dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
    String.class, 2000, null, true));
Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
ambari=> \d+ viewinstanceproperty;
                        Table "ambari.viewinstanceproperty"
       Column       |          Type           | Modifiers | Storage  | Description
--------------------+-------------------------+-----------+----------+-------------
 view_name          | character varying(255)  | not null  | extended |
 view_instance_name | character varying(255)  | not null  | extended |
 name               | character varying(255)  | not null  | extended |
 value              | character varying(2000) | not null  | extended |


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
  ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 

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


Testing
-------

Unit tests passed

Manually tested upgrade on PostreSQL, MySql, Oracle


Thanks,

Dmytro Sen


Re: Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

Posted by Vitalyi Brodetskyi <vb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37656/#review95974
-----------------------------------------------------------

Ship it!


Ship It!

- Vitalyi Brodetskyi


On Сер. 20, 2015, 5:05 після полудня, Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37656/
> -----------------------------------------------------------
> 
> (Updated Сер. 20, 2015, 5:05 після полудня)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.
> 
> 
> Bugs: AMBARI-12836
>     https://issues.apache.org/jira/browse/AMBARI-12836
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I think that the alterColumn in the upgrade catalog may not be working.
> dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
>     String.class, 2000, null, true));
> Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
> ambari=> \d+ viewinstanceproperty;
>                         Table "ambari.viewinstanceproperty"
>        Column       |          Type           | Modifiers | Storage  | Description
> --------------------+-------------------------+-----------+----------+-------------
>  view_name          | character varying(255)  | not null  | extended |
>  view_instance_name | character varying(255)  | not null  | extended |
>  name               | character varying(255)  | not null  | extended |
>  value              | character varying(2000) | not null  | extended |
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 
> 
> Diff: https://reviews.apache.org/r/37656/diff/
> 
> 
> Testing
> -------
> 
> Unit tests passed
> 
> Manually tested upgrade on PostreSQL, MySql, Oracle
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>


Re: Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

Posted by Myroslav Papirkovskyy <mp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37656/#review95977
-----------------------------------------------------------

Ship it!


Ship It!

- Myroslav Papirkovskyy


On Сер. 20, 2015, 8:22 після полудня, Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37656/
> -----------------------------------------------------------
> 
> (Updated Сер. 20, 2015, 8:22 після полудня)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.
> 
> 
> Bugs: AMBARI-12836
>     https://issues.apache.org/jira/browse/AMBARI-12836
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I think that the alterColumn in the upgrade catalog may not be working.
> dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
>     String.class, 2000, null, true));
> Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
> ambari=> \d+ viewinstanceproperty;
>                         Table "ambari.viewinstanceproperty"
>        Column       |          Type           | Modifiers | Storage  | Description
> --------------------+-------------------------+-----------+----------+-------------
>  view_name          | character varying(255)  | not null  | extended |
>  view_instance_name | character varying(255)  | not null  | extended |
>  name               | character varying(255)  | not null  | extended |
>  value              | character varying(2000) | not null  | extended |
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 
> 
> Diff: https://reviews.apache.org/r/37656/diff/
> 
> 
> Testing
> -------
> 
> Unit tests passed
> 
> Manually tested upgrade on PostreSQL, MySql, Oracle
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>


Re: Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

Posted by Dmytro Sen <ds...@hortonworks.com>.

> On Авг. 20, 2015, 5:41 п.п., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java, line 517
> > <https://reviews.apache.org/r/37656/diff/2/?file=1045162#file1045162line517>
> >
> >     Can we add doc to this method to indicate that it does not perform a null/non-null constraint change?

After my patch, it does.


- Dmytro


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


On Авг. 20, 2015, 5:22 п.п., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37656/
> -----------------------------------------------------------
> 
> (Updated Авг. 20, 2015, 5:22 п.п.)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.
> 
> 
> Bugs: AMBARI-12836
>     https://issues.apache.org/jira/browse/AMBARI-12836
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I think that the alterColumn in the upgrade catalog may not be working.
> dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
>     String.class, 2000, null, true));
> Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
> ambari=> \d+ viewinstanceproperty;
>                         Table "ambari.viewinstanceproperty"
>        Column       |          Type           | Modifiers | Storage  | Description
> --------------------+-------------------------+-----------+----------+-------------
>  view_name          | character varying(255)  | not null  | extended |
>  view_instance_name | character varying(255)  | not null  | extended |
>  name               | character varying(255)  | not null  | extended |
>  value              | character varying(2000) | not null  | extended |
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 
> 
> Diff: https://reviews.apache.org/r/37656/diff/
> 
> 
> Testing
> -------
> 
> Unit tests passed
> 
> Manually tested upgrade on PostreSQL, MySql, Oracle
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>


Re: Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37656/#review95982
-----------------------------------------------------------

Ship it!



ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java (line 517)
<https://reviews.apache.org/r/37656/#comment151172>

    Can we add doc to this method to indicate that it does not perform a null/non-null constraint change?


- Jonathan Hurley


On Aug. 20, 2015, 1:22 p.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37656/
> -----------------------------------------------------------
> 
> (Updated Aug. 20, 2015, 1:22 p.m.)
> 
> 
> Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.
> 
> 
> Bugs: AMBARI-12836
>     https://issues.apache.org/jira/browse/AMBARI-12836
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> I think that the alterColumn in the upgrade catalog may not be working.
> dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
>     String.class, 2000, null, true));
> Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
> ambari=> \d+ viewinstanceproperty;
>                         Table "ambari.viewinstanceproperty"
>        Column       |          Type           | Modifiers | Storage  | Description
> --------------------+-------------------------+-----------+----------+-------------
>  view_name          | character varying(255)  | not null  | extended |
>  view_instance_name | character varying(255)  | not null  | extended |
>  name               | character varying(255)  | not null  | extended |
>  value              | character varying(2000) | not null  | extended |
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
>   ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
>   ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 
> 
> Diff: https://reviews.apache.org/r/37656/diff/
> 
> 
> Testing
> -------
> 
> Unit tests passed
> 
> Manually tested upgrade on PostreSQL, MySql, Oracle
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>


Re: Review Request 37656: During upgrade, ALTER statements to change nullability of columns are not taking effect

Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37656/
-----------------------------------------------------------

(Updated Авг. 20, 2015, 5:22 п.п.)


Review request for Ambari, Myroslav Papirkovskyy, Sumit Gupta, and Vitalyi Brodetskyi.


Bugs: AMBARI-12836
    https://issues.apache.org/jira/browse/AMBARI-12836


Repository: ambari


Description
-------

I think that the alterColumn in the upgrade catalog may not be working.
dbAccessor.alterColumn("viewinstanceproperty", new DBColumnInfo("value",
    String.class, 2000, null, true));
Performed a deployment of 1.6.1 and upgraded to 2.0.1. The column is still not nullable.
ambari=> \d+ viewinstanceproperty;
                        Table "ambari.viewinstanceproperty"
       Column       |          Type           | Modifiers | Storage  | Description
--------------------+-------------------------+-----------+----------+-------------
 view_name          | character varying(255)  | not null  | extended |
 view_instance_name | character varying(255)  | not null  | extended |
 name               | character varying(255)  | not null  | extended |
 value              | character varying(2000) | not null  | extended |


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessor.java 19a516c 
  ambari-server/src/main/java/org/apache/ambari/server/orm/DBAccessorImpl.java 154645a 
  ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/PostgresHelper.java 821b521 
  ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java 595078f 
  ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog211Test.java b41b105 

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


Testing
-------

Unit tests passed

Manually tested upgrade on PostreSQL, MySql, Oracle


Thanks,

Dmytro Sen