phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] swaroopak commented on a change in pull request #514: PHOENIX-5261: Implement ALTER TABLE/VIEW ADD COLUMN CASCADE
Date Tue, 11 Jun 2019 17:30:45 GMT
swaroopak commented on a change in pull request #514: PHOENIX-5261: Implement ALTER TABLE/VIEW
ADD COLUMN CASCADE
URL: https://github.com/apache/phoenix/pull/514#discussion_r292575626
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/ParameterizedAlterTableCascadeIT.java
 ##########
 @@ -0,0 +1,307 @@
+/*
+ * 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.end2end;
+
+import org.apache.phoenix.schema.PTableImpl;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Properties;
+
+@RunWith(Parameterized.class)
+public class ParameterizedAlterTableCascadeIT extends ParallelStatsDisabledIT {
+
+    @Rule
+    public ExpectedException exception = ExpectedException.none();
+    private static Connection conn;
+    private Properties prop;
+    private boolean isViewIndex;
+    private boolean isLocalIndex;
+    private String databaseObjectName;
+    private String indexesName;
+    private String planOutput;
+    private final String tableDDLOptions;
+
+
+    public ParameterizedAlterTableCascadeIT(boolean isViewIndex, boolean isLocalIndex, boolean
mutable, boolean columnEncoded, String transactionProvider) {
+		this.isViewIndex = isViewIndex;
+		this.isLocalIndex = isLocalIndex;
+        StringBuilder optionBuilder = new StringBuilder();
+        if (transactionProvider != "") {
+            optionBuilder.append("TRANSACTION_PROVIDER='" + transactionProvider + "'");
+        }
+        if (!columnEncoded) {
+            optionBuilder.append(",COLUMN_ENCODED_BYTES=0");
+        }
+        if (!mutable) {
+            optionBuilder.append(",IMMUTABLE_ROWS=true");
+            if (!columnEncoded) {
+                optionBuilder.append(",IMMUTABLE_STORAGE_SCHEME="+ PTableImpl.ImmutableStorageScheme.ONE_CELL_PER_COLUMN);
+            }
+        }
+        this.tableDDLOptions = optionBuilder.toString();
+	}
+
+	@Parameters(name="ParameterizedAlterTableCascadeIT_isViewIndex={0},isLocalIndex={1},mutable={2},columnEncoded={3},transactionProvider={4}")
+	public static Collection<Object[]> data() {
+        return Arrays.asList(new Object[][] {
 
 Review comment:
   Not that I am aware of, but I 'll find it if there is something like this, it will certainly
benefit such a long list of parameters. 
   
   Yes, it was overkill to fit transactions scenario also in the same test suite, plus my
IDE would run out of memory in running more than 128 tests in a single program.  

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