phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] priyankporwal commented on a change in pull request #508: PHOENIX-5283: Add CASCADE INDEX ALL in the SQL Grammar of ALTER TABLE…
Date Fri, 17 May 2019 05:32:30 GMT
priyankporwal commented on a change in pull request #508: PHOENIX-5283: Add CASCADE INDEX ALL
in the SQL Grammar of ALTER TABLE…
URL: https://github.com/apache/phoenix/pull/508#discussion_r284982621
 
 

 ##########
 File path: phoenix-core/src/test/java/org/apache/phoenix/query/AlterTableTest.java
 ##########
 @@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.query;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public class AlterTableTest extends BaseConnectionlessQueryTest {
+
+    @Rule
+    public ExpectedException exception = ExpectedException.none();
+    private Connection conn;
+    private Properties prop;
+
+    @Before
+    public void doMiniSetup() throws SQLException {
+        prop = new Properties();
+        conn = DriverManager.getConnection(getUrl(), prop);
+        conn.createStatement().execute("CREATE TABLE TEST_TABLE(key_column INTEGER NOT NULL,
" +
+                "value_column BIGINT, CONSTRAINT my_pk PRIMARY KEY (key_column))");
+        conn.createStatement().execute("CREATE VIEW TEST_TABLE_GLOBAL_VIEW(name VARCHAR,
age BIGINT) AS " +
+                "SELECT * FROM TEST_TABLE" +
+                " WHERE key_column = 1");
+
+    }
+
+    // Exception for WIP for Table
+    @Test
+    public void testAlterTableAddCascade() throws SQLException {
+        String query = "ALTER TABLE TEST_TABLE ADD CASCADE INDEX ALL new_column VARCHAR";
+        exception.expectMessage("This feature is WIP. Please refer to PHOENIX-5261");
 
 Review comment:
   This entire string is repeated between prod code and test. Likewise for line 62 below.
Is this the convention in existing tests? Possibility to add const strings in prod code and
re-use in test?

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


With regards,
Apache Git Services

Mime
View raw message