vincentpoon commented on a change in pull request #445: PHOENIX-2787 support IF 
EXISTS for ALTER TABLE SET options
URL: https://github.com/apache/phoenix/pull/445#discussion_r263105240
 
 

 ##########
 File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
 ##########
 @@ -1352,7 +1352,34 @@ private void assertSequenceNumber(String schemaName, 
String tableName, long expe
             assertFalse(rs.next());
         }
     }
-    
+
+    @Test
+    public void testAlterTableIfExistsThenOption() throws Exception {
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        conn.setAutoCommit(false);
+        String ddl = "CREATE TABLE FOO (A VARCHAR  PRIMARY KEY, B VARCHAR)";
+        createTestTable(getUrl(), ddl);
+
+        // testing ALTER TABLE ADD WITH IF EXISTS SET OPTION
+        try {
+            conn.createStatement().execute("ALTER TABLE FOO ADD C VARCHAR IF 
EXISTS" +
+                    "  SET DISABLE_WAL = true");
+        } catch (SQLException e){
+            assertEquals(SQLExceptionCode.MISSING_TOKEN.getErrorCode(), 
e.getErrorCode());
 
 Review comment:
   why does this case throw an exception?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to