You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2023/12/12 13:48:30 UTC
(flink) 02/02: [FLINK-33421] Remove UnionJsonPlanTest and UnionJsonPlanITCase
This is an automated email from the ASF dual-hosted git repository.
dwysakowicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit f2460363303e49621589b1cb2b45347c8ee5dd4f
Author: bvarghese1 <bv...@confluent.io>
AuthorDate: Thu Nov 2 12:35:37 2023 -0700
[FLINK-33421] Remove UnionJsonPlanTest and UnionJsonPlanITCase
- These have been covered by the new restore tests
- Related commit: 960a692488614b2c9214ed6ff8b19713f5f31879
---
.../plan/nodes/exec/stream/UnionJsonPlanTest.java | 74 ----------------------
.../stream/jsonplan/UnionJsonPlanITCase.java | 66 -------------------
2 files changed, 140 deletions(-)
diff --git a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/UnionJsonPlanTest.java b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/UnionJsonPlanTest.java
deleted file mode 100644
index bbb1b041c23..00000000000
--- a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/UnionJsonPlanTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.flink.table.planner.plan.nodes.exec.stream;
-
-import org.apache.flink.table.api.TableConfig;
-import org.apache.flink.table.api.TableEnvironment;
-import org.apache.flink.table.planner.utils.StreamTableTestUtil;
-import org.apache.flink.table.planner.utils.TableTestBase;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-/** Test json serialization/deserialization for union. */
-class UnionJsonPlanTest extends TableTestBase {
- private StreamTableTestUtil util;
- private TableEnvironment tEnv;
-
- @BeforeEach
- void setup() {
- util = streamTestUtil(TableConfig.getDefault());
- tEnv = util.getTableEnv();
-
- String srcTableDdl =
- "CREATE TABLE MyTable (\n"
- + " a bigint,\n"
- + " b int not null,\n"
- + " c varchar,\n"
- + " d timestamp(3)\n"
- + ") with (\n"
- + " 'connector' = 'values',\n"
- + " 'bounded' = 'false')";
- tEnv.executeSql(srcTableDdl);
-
- String srcTableDdl2 =
- "CREATE TABLE MyTable2 (\n"
- + " d bigint,\n"
- + " e int not null\n"
- + ") with (\n"
- + " 'connector' = 'values',\n"
- + " 'bounded' = 'false')";
- tEnv.executeSql(srcTableDdl2);
- }
-
- @Test
- void testUnion() {
- String sinkTableDdl =
- "CREATE TABLE MySink (\n"
- + " a bigint,\n"
- + " b int\n"
- + ") with (\n"
- + " 'connector' = 'values',\n"
- + " 'table-sink-class' = 'DEFAULT')";
- tEnv.executeSql(sinkTableDdl);
- util.verifyJsonPlan(
- "insert into MySink select * from"
- + " (select a, b from MyTable) union all (select d, e from MyTable2)");
- }
-}
diff --git a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/jsonplan/UnionJsonPlanITCase.java b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/jsonplan/UnionJsonPlanITCase.java
deleted file mode 100644
index 2145dd0179a..00000000000
--- a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/jsonplan/UnionJsonPlanITCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.flink.table.planner.runtime.stream.jsonplan;
-
-import org.apache.flink.table.planner.factories.TestValuesTableFactory;
-import org.apache.flink.table.planner.runtime.utils.TestData;
-import org.apache.flink.table.planner.utils.JavaScalaConversionUtil;
-import org.apache.flink.table.planner.utils.JsonPlanTestBase;
-
-import org.junit.jupiter.api.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-/** Test json serialization/deserialization for union. */
-class UnionJsonPlanITCase extends JsonPlanTestBase {
- @Test
- void testUnion() throws Exception {
- createTestValuesSourceTable(
- "MyTable",
- JavaScalaConversionUtil.toJava(TestData.data1()),
- "a int",
- "b varchar",
- "c int");
- createTestValuesSourceTable(
- "MyTable2",
- JavaScalaConversionUtil.toJava(TestData.data1()),
- "a int",
- "b varchar",
- "c int");
- createTestNonInsertOnlyValuesSinkTable("MySink", "a int", "b varchar", "c bigint");
-
- String dml =
- "INSERT INTO MySink "
- + "(SELECT * FROM MyTable where a >=3)"
- + " union all (select * from MyTable2 where a <= 3)";
- compileSqlAndExecutePlan(dml).await();
- List<String> expected =
- Arrays.asList(
- "+I[2, a, 6]",
- "+I[4, b, 8]",
- "+I[6, c, 10]",
- "+I[1, a, 5]",
- "+I[3, b, 7]",
- "+I[5, c, 9]",
- "+I[3, b, 7]" // a=3 need to be doubled
- );
- assertResult(expected, TestValuesTableFactory.getResultsAsStrings("MySink"));
- }
-}