You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ya...@apache.org on 2020/12/11 21:38:28 UTC
[phoenix] branch master updated: PHOENIX-6252 Fix
BackwardCompatibilityIT test flapper
This is an automated email from the ASF dual-hosted git repository.
yanxinyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new 16b0565 PHOENIX-6252 Fix BackwardCompatibilityIT test flapper
16b0565 is described below
commit 16b05655796ad5f51e62aff88fa61d2e933923d3
Author: Xinyi Yan <xy...@salesforce.com>
AuthorDate: Wed Dec 9 17:01:52 2020 -0800
PHOENIX-6252 Fix BackwardCompatibilityIT test flapper
Signed-off-by: Xinyi Yan <ya...@apache.org>
---
...ackwardCompatibilityForSplittableSyscatIT.java} | 15 +++++++------
.../end2end/BackwardCompatibilityTestUtil.java | 3 +++
.../gold_query_delete_for_splitable_syscat.txt | 22 +++++++++++++++++++
.../query_delete_for_splitable_syscat.sql | 25 ++++++++++++++++++++++
4 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplitableSyscatIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplittableSyscatIT.java
similarity index 87%
rename from phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplitableSyscatIT.java
rename to phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplittableSyscatIT.java
index c100930..92f4471 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplitableSyscatIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityForSplittableSyscatIT.java
@@ -29,7 +29,7 @@ import java.util.Collection;
import java.util.Map;
import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.CREATE_TMP_TABLE;
-import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_DELETE;
+import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_DELETE_FOR_SPLITTABLE_SYSCAT;
import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_SELECT_AND_DROP_TABLE;
import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.assertExpectedOutput;
import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.checkForPreConditions;
@@ -44,7 +44,7 @@ import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.UpgradePr
@RunWith(Parameterized.class)
@Category(NeedsOwnMiniClusterTest.class)
-public class BackwardCompatibilityForSplitableSyscatIT extends SplitSystemCatalogIT {
+public class BackwardCompatibilityForSplittableSyscatIT extends SplitSystemCatalogIT {
private final String compatibleClientVersion;
private String zkQuorum;
private String url;
@@ -54,7 +54,7 @@ public class BackwardCompatibilityForSplitableSyscatIT extends SplitSystemCatalo
return computeClientVersions();
}
- public BackwardCompatibilityForSplitableSyscatIT(String compatibleClientVersion) {
+ public BackwardCompatibilityForSplittableSyscatIT(String compatibleClientVersion) {
this.compatibleClientVersion = compatibleClientVersion;
}
@@ -69,14 +69,15 @@ public class BackwardCompatibilityForSplitableSyscatIT extends SplitSystemCatalo
@Test
public void testSplittableSyscatWithOldClientForAddingDataAndDelete() throws Exception {
- executeQueryWithClientVersion(compatibleClientVersion, QUERY_DELETE, zkQuorum);
- assertExpectedOutput(QUERY_DELETE);
+ executeQueryWithClientVersion(compatibleClientVersion,
+ QUERY_DELETE_FOR_SPLITTABLE_SYSCAT, zkQuorum);
+ assertExpectedOutput(QUERY_DELETE_FOR_SPLITTABLE_SYSCAT);
}
@Test
public void testSplittableSyscatWithNewClientForAddingDataAndDelete() throws Exception {
- executeQueriesWithCurrentVersion(QUERY_DELETE, url, NONE);
- assertExpectedOutput(QUERY_DELETE);
+ executeQueriesWithCurrentVersion(QUERY_DELETE_FOR_SPLITTABLE_SYSCAT, url, NONE);
+ assertExpectedOutput(QUERY_DELETE_FOR_SPLITTABLE_SYSCAT);
}
@Test
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
index 049b6f0..1ad17f7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
@@ -77,12 +77,15 @@ public final class BackwardCompatibilityTestUtil {
public static final String ADD_DELETE = "add_delete";
public static final String ADD_VIEW_INDEX = "add_view_index";
public static final String DELETE = "delete";
+ public static final String DELETE_FOR_SPLITABLE_SYSCAT = "delete_for_splitable_syscat";
public static final String VIEW_INDEX = "view_index";
public static final String SELECT_AND_DROP_TABLE = "select_and_drop_table";
public static final String QUERY_CREATE_ADD = QUERY_PREFIX + CREATE_ADD;
public static final String QUERY_ADD_DATA = QUERY_PREFIX + ADD_DATA;
public static final String QUERY_ADD_DELETE = QUERY_PREFIX + ADD_DELETE;
public static final String QUERY_DELETE = QUERY_PREFIX + DELETE;
+ public static final String QUERY_DELETE_FOR_SPLITTABLE_SYSCAT =
+ QUERY_PREFIX + DELETE_FOR_SPLITABLE_SYSCAT;
public static final String QUERY_SELECT_AND_DROP_TABLE = QUERY_PREFIX + SELECT_AND_DROP_TABLE;
public static final String QUERY_CREATE_DIVERGED_VIEW = QUERY_PREFIX + CREATE_DIVERGED_VIEW;
public static final String QUERY_VIEW_INDEX = QUERY_PREFIX + VIEW_INDEX;
diff --git a/phoenix-core/src/it/resources/gold_files/gold_query_delete_for_splitable_syscat.txt b/phoenix-core/src/it/resources/gold_files/gold_query_delete_for_splitable_syscat.txt
new file mode 100644
index 0000000..1f3d8e9
--- /dev/null
+++ b/phoenix-core/src/it/resources/gold_files/gold_query_delete_for_splitable_syscat.txt
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+ 'COUNT(1)'
+'1'
+'ID','NAME'
+'a','a_name'
\ No newline at end of file
diff --git a/phoenix-core/src/it/resources/sql_files/query_delete_for_splitable_syscat.sql b/phoenix-core/src/it/resources/sql_files/query_delete_for_splitable_syscat.sql
new file mode 100644
index 0000000..ba511d4
--- /dev/null
+++ b/phoenix-core/src/it/resources/sql_files/query_delete_for_splitable_syscat.sql
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+CREATE TABLE if not exists my_schema.my_table_delete5
+ (id VARCHAR not null primary key, name VARCHAR) SALT_BUCKETS=4;
+UPSERT INTO my_schema.my_table_delete5 values ('a','a_name');
+
+SELECT COUNT(*) from my_schema.my_table_delete5;
+SELECT * from my_schema.my_table_delete5;
+DROP TABLE my_schema.my_table_delete5;
\ No newline at end of file