You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/09/10 20:04:20 UTC

[jira] [Updated] (PHOENIX-3167) CREATE TABLE on an existing table resets the HTableMetadata

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

James Taylor updated PHOENIX-3167:
----------------------------------
    Fix Version/s:     (was: 4.8.1)
                   4.9.0

> CREATE TABLE on an existing table resets the HTableMetadata
> -----------------------------------------------------------
>
>                 Key: PHOENIX-3167
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3167
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>             Fix For: 4.9.0
>
>         Attachments: PHOENIX-3167.patch
>
>
> {code}
> @Test
>     public void testRecreatingExistingTableMaintainsHTableProperties() throws Exception {
>         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
>         Connection conn = DriverManager.getConnection(getUrl(), props);
>         String ddl = "ALTER TABLE SYSTEM.CATALOG SET KEEP_DELETED_CELLS = false";
>         conn.createStatement().execute(ddl);
>         assertDeleteCellsDisabled(conn);
>         try {
>             conn.createStatement().execute(QueryConstants.CREATE_TABLE_METADATA);
>         } catch (TableAlreadyExistsException e) {
>         }
>         assertDeleteCellsDisabled(conn);
>     }
>     
>     private void assertDeleteCellsDisabled(Connection conn) throws org.apache.hadoop.hbase.TableNotFoundException,
>             IOException, SQLException {
>         try (HBaseAdmin admin = conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) {
>             HTableDescriptor tableDesc = admin.getTableDescriptor(Bytes.toBytes("SYSTEM.CATALOG"));
>             HColumnDescriptor[] columnFamilies = tableDesc.getColumnFamilies();
>             assertEquals("0", columnFamilies[0].getNameAsString());
>             assertEquals(KeepDeletedCells.FALSE, columnFamilies[0].getKeepDeletedCells());
>         }
>     }
> {code}
> [~jamestaylor], [~apurtell], [~lhofhansl], [~mujtabachohan] - this is likely why we saw that the keep deleted cells property always kept flipping to true even though we set it to false in hbase shell.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)