You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/11/25 19:21:50 UTC

[GitHub] [phoenix] yanxinyi commented on a change in pull request #987: PHOENIX-5960 : Creating view on non-existent table should throw TNFE

yanxinyi commented on a change in pull request #987:
URL: https://github.com/apache/phoenix/pull/987#discussion_r530596046



##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##########
@@ -801,6 +802,37 @@ public void testSetTableDescriptorPropertyOnView() throws Exception {
         conn2.close();
     }
 
+    @Test
+    public void testCreateViewFromNonExistentTable() throws Exception {
+        try (Connection conn = DriverManager.getConnection(getUrl())) {
+            conn.createStatement().execute(
+                "CREATE TABLE IF NOT EXISTS S.T1 (A INTEGER PRIMARY KEY, B INTEGER)");
+            // 1. create view from non-existent table (without schema)
+            try {
+                conn.createStatement().execute(
+                    "CREATE VIEW IF NOT EXISTS V1(C INTEGER) AS SELECT * FROM T2");
+            } catch (TableNotFoundException e) {

Review comment:
       oh yeah, this is nicer than a flag :) 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org