palashc commented on code in PR #1859:
URL: https://github.com/apache/phoenix/pull/1859#discussion_r1562954852
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java:
##########
@@ -1174,21 +1175,16 @@ public void testDroppingIndexedColDropsViewIndex()
throws Exception {
}
// verify index metadata was dropped
- try {
- viewConn.createStatement().execute("SELECT * FROM " +
fullNameViewIndex1 );
- fail("Index metadata should have been dropped");
- } catch (TableNotFoundException e) {
- }
-
pconn = viewConn.unwrap(PhoenixConnection.class);
- view = pconn.getTable(new PTableKey(tenantId, viewOfTable ));
+ view = pconn.getTableNoCache(viewOfTable);
+ assertEquals("Unexpected number of indexes ", 1,
view.getIndexes().size());
+ assertEquals("Unexpected index ", fullNameViewIndex2 ,
view.getIndexes().get(0).getName().getString());
+ assertNotEquals("Dropped index should not be in view metadata ",
fullNameViewIndex1 , view.getIndexes().get(0).getName().getString());
try {
- viewIndex = pconn.getTable(new PTableKey(tenantId,
fullNameViewIndex1 ));
+ viewIndex = pconn.getTableNoCache(fullNameViewIndex1);
Review Comment:
This is to make sure that the view index is fetched from the server and not
from the client's cache. The test is verifying whether the view index was
dropped on the server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]