phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas D'Silva (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-3522) Altering the mutability of a parent table does not propagate to the child views
Date Thu, 08 Dec 2016 08:04:58 GMT

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

Thomas D'Silva updated PHOENIX-3522:
------------------------------------
    Attachment: PHOENIX-3522.patch

[~jamestaylor]

This patch propagates all table properties that are changing on the base table that are mutable
and valid on views  to the child views.
I file a separate JIRA to handle UPDATE_CACHE_FREQUENCY as a special case.

Can you please review. 

> Altering the mutability of a parent table does not propagate to the child views
> -------------------------------------------------------------------------------
>
>                 Key: PHOENIX-3522
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3522
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Thomas D'Silva
>            Assignee: Thomas D'Silva
>             Fix For: 4.9.1
>
>         Attachments: PHOENIX-3522.patch
>
>
> The following test fails
> {code}
> @Test
>     public void testAlterMutabilityOfParentTable() throws Exception {
>         try (Connection conn = DriverManager.getConnection(getUrl());
>                 Connection viewConn = isMultiTenant ? DriverManager.getConnection(TENANT_SPECIFIC_URL1)
: conn ) {       
>             String tableName = generateUniqueName();
>             String viewOfTable = tableName + "_VIEW";
>             String ddlFormat = "CREATE TABLE IF NOT EXISTS " + tableName + " ("
>                             + " %s ID char(1) NOT NULL,"
>                             + " COL1 integer NOT NULL,"
>                             + " COL2 bigint NOT NULL,"
>                             + " CONSTRAINT NAME_PK PRIMARY KEY (%s ID, COL1, COL2)"
>                             + " ) %s";
>             conn.createStatement().execute(generateDDL(ddlFormat));
>             
>             viewConn.createStatement().execute("CREATE VIEW " + viewOfTable + " ( VIEW_COL1
DECIMAL(10,2), VIEW_COL2 VARCHAR ) AS SELECT * FROM " + tableName);
>             
>             conn.createStatement().execute("ALTER TABLE " + tableName + " SET IMMUTABLE_ROWS=true");
>             PhoenixConnection phoenixConn = conn.unwrap(PhoenixConnection.class);
>             PTable table = phoenixConn.getTable(new PTableKey(null, tableName));
>             assertTrue(table.isImmutableRows());
>             PTable view = phoenixConn.getTable(new PTableKey(null, viewOfTable));
>             assertTrue(view.isImmutableRows());
>         } 
>     }
> {code}



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

Mime
View raw message