phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Hofhansl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3340) Dropping column doesn't drop index for local immutable indexes with STORE_COLUMNS_IN_SINGLE_CELL
Date Sat, 22 Apr 2017 04:49:04 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15979763#comment-15979763
] 

Lars Hofhansl commented on PHOENIX-3340:
----------------------------------------

Is this still an issue?

> Dropping column doesn't drop index for local immutable indexes with STORE_COLUMNS_IN_SINGLE_CELL
> ------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-3340
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3340
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>
> Test case on encode columns branch that fails:
> {code}
> @Test
> public void testDropIndexedColumnImmutableIndex() throws Exception {
>         helpTestDropIndexedColumn(true);
>     }
>     
>     private void helpTestDropIndexedColumn(boolean immutable) throws Exception {
>         String query;
>         ResultSet rs;
>         PreparedStatement stmt;
>         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
>         Connection conn = DriverManager.getConnection(getUrl(), props);
>         conn.setAutoCommit(false);
>         // make sure that the tables are empty, but reachable
>         conn.createStatement().execute(
>           "CREATE TABLE " + DATA_TABLE_FULL_NAME
>               + " (k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR, v2 VARCHAR) " + (immutable
? "IMMUTABLE_ROWS = true" : ""));
>         query = "SELECT * FROM " + DATA_TABLE_FULL_NAME;
>         rs = conn.createStatement().executeQuery(query);
>         assertFalse(rs.next());
>         conn.createStatement().execute(
>           "CREATE INDEX " + INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME + " (v1,
v2)");
>         conn.createStatement().execute(
>             "CREATE LOCAL INDEX " + LOCAL_INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME
+ " (v1, v2)");
>         query = "SELECT * FROM " + INDEX_TABLE_FULL_NAME;
>         rs = conn.createStatement().executeQuery(query);
>         assertFalse(rs.next());
>         // load some data into the table
>         stmt = conn.prepareStatement("UPSERT INTO " + DATA_TABLE_FULL_NAME + " VALUES(?,?,?)");
>         stmt.setString(1, "a");
>         stmt.setString(2, "x");
>         stmt.setString(3, "1");
>         stmt.execute();
>         conn.commit();
>         assertIndexExists(conn,true);
>         conn.createStatement().execute("ALTER TABLE " + DATA_TABLE_FULL_NAME + " DROP
COLUMN v1");
>         assertIndexExists(conn,false);
>         query = "SELECT * FROM " + DATA_TABLE_FULL_NAME;
>         rs = conn.createStatement().executeQuery(query);
>         assertTrue(rs.next());
>         assertEquals("a",rs.getString(1));
>         assertEquals("1",rs.getString(2));
>         assertFalse(rs.next());
>         // load some data into the table
>         stmt = conn.prepareStatement("UPSERT INTO " + DATA_TABLE_FULL_NAME + " VALUES(?,?)");
>         stmt.setString(1, "a");
>         stmt.setString(2, "2");
>         stmt.execute();
>         conn.commit();
>         query = "SELECT * FROM " + DATA_TABLE_FULL_NAME;
>         rs = conn.createStatement().executeQuery(query);
>         assertTrue(rs.next());
>         assertEquals("a",rs.getString(1));
>         assertEquals("2",rs.getString(2));
>         assertFalse(rs.next());
>     }
> {code}
> FYI, [~tdsilva]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message