This is an automated email from the ASF dual-hosted git repository. yanxinyi pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x by this push: new d43c362 PHOENIX-6252 Fix BackwardCompatibilityIT test flapper d43c362 is described below commit d43c36230d166d1296ed650230f52623553e2da0 Author: Xinyi Yan <x...@salesforce.com> AuthorDate: Wed Dec 9 11:58:31 2020 -0800 PHOENIX-6252 Fix BackwardCompatibilityIT test flapper Signed-off-by: Xinyi Yan <yanxi...@apache.org> --- ...ackwardCompatibilityForSplittableSyscatIT.java} | 17 ++++++++------- .../end2end/BackwardCompatibilityTestUtil.java | 3 +++ .../gold_query_delete_for_splitable_syscat.txt | 22 +++++++++++++++++++ .../query_delete_for_splitable_syscat.sql | 25 ++++++++++++++++++++++ 4 files changed, 59 insertions(+), 8 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 8bc4962..607aa09 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 @@ -30,10 +30,10 @@ import org.junit.runners.Parameterized; import java.util.Collection; import java.util.Map; -import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.CREATE_ADD; + import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.CREATE_TMP_TABLE; -import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_CREATE_ADD; import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_DELETE; +import static org.apache.phoenix.end2end.BackwardCompatibilityTestUtil.QUERY_DELETE_FOR_SPLITABLE_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; @@ -48,7 +48,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 static String zkQuorum; private static String url; @@ -58,7 +58,7 @@ public class BackwardCompatibilityForSplitableSyscatIT extends SplitSystemCatalo return computeClientVersions(); } - public BackwardCompatibilityForSplitableSyscatIT(String compatibleClientVersion) { + public BackwardCompatibilityForSplittableSyscatIT(String compatibleClientVersion) { this.compatibleClientVersion = compatibleClientVersion; } @@ -73,14 +73,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_SPLITABLE_SYSCAT, zkQuorum); + assertExpectedOutput(QUERY_DELETE_FOR_SPLITABLE_SYSCAT); } @Test public void testSplittableSyscatWithNewClientForAddingDataAndDelete() throws Exception { - executeQueriesWithCurrentVersion(QUERY_DELETE, url, NONE); - assertExpectedOutput(QUERY_DELETE); + executeQueriesWithCurrentVersion(QUERY_DELETE_FOR_SPLITABLE_SYSCAT, url, NONE); + assertExpectedOutput(QUERY_DELETE_FOR_SPLITABLE_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 3d1cfd4..b287270 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 @@ -78,11 +78,14 @@ public final class BackwardCompatibilityTestUtil { public static final String ADD_DATA = "add_data"; public static final String ADD_DELETE = "add_delete"; 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_FOR_SPLITABLE_SYSCAT = + QUERY_PREFIX + DELETE_FOR_SPLITABLE_SYSCAT; public static final String QUERY_DELETE = QUERY_PREFIX + DELETE; public static final String QUERY_VIEW_INDEX = QUERY_PREFIX + VIEW_INDEX; public static final String QUERY_SELECT_AND_DROP_TABLE = QUERY_PREFIX + SELECT_AND_DROP_TABLE; 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..3607c2b --- /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..5dc790e --- /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;