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/12/09 19:04:58 UTC
[jira] [Commented] (PHOENIX-3522) Altering the mutability of a
parent table does not propagate to the child views
[ https://issues.apache.org/jira/browse/PHOENIX-3522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15736032#comment-15736032 ]
James Taylor commented on PHOENIX-3522:
---------------------------------------
+1
> 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)