Github user twdsilva commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/303#discussion_r201835494
--- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
---
@@ -372,6 +378,31 @@ public void testViewAndTableAndDrop() throws Exception
{
// drop table cascade should succeed
conn.createStatement().execute("DROP TABLE " + fullTableName + "
CASCADE");
+ validateViewDoesNotExist(conn, fullViewName1);
+ validateViewDoesNotExist(conn, fullViewName2);
+
+ }
+
+ @Test
+ public void testRecreateDroppedTableWithChildViews() throws Exception {
--- End diff --
We write the parent->child link first, then if the table uses column
encoding we update the encoded column qualifiers on the parent table, and
finally use mutateRowsWithLocks to write the view metadata atomically.
We ignore views that can't be found (in case writing the child view
metadata fails).
If the metadata write fails and the table uses column encoding then we will
lose a few column qualifiers.
I'll add a test for this.
---