You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by lz...@apache.org on 2023/03/08 05:51:54 UTC

[flink-table-store] branch master updated: [FLINK-31365] Fix unstable FlinkActionsE2ETest#testMergeInto by simplifying it

This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-table-store.git


The following commit(s) were added to refs/heads/master by this push:
     new 65335ee9 [FLINK-31365] Fix unstable FlinkActionsE2ETest#testMergeInto by simplifying it
65335ee9 is described below

commit 65335ee90aa0b78a0bd8cf18ae351c7696148e23
Author: yuzelin <33...@users.noreply.github.com>
AuthorDate: Wed Mar 8 13:51:48 2023 +0800

    [FLINK-31365] Fix unstable FlinkActionsE2ETest#testMergeInto by simplifying it
    
    This closes #587
---
 .../table/store/tests/FlinkActionsE2eTest.java     | 62 ++++------------------
 1 file changed, 11 insertions(+), 51 deletions(-)

diff --git a/flink-table-store-e2e-tests/src/test/java/org/apache/flink/table/store/tests/FlinkActionsE2eTest.java b/flink-table-store-e2e-tests/src/test/java/org/apache/flink/table/store/tests/FlinkActionsE2eTest.java
index a5a0376f..7b1e2248 100644
--- a/flink-table-store-e2e-tests/src/test/java/org/apache/flink/table/store/tests/FlinkActionsE2eTest.java
+++ b/flink-table-store-e2e-tests/src/test/java/org/apache/flink/table/store/tests/FlinkActionsE2eTest.java
@@ -262,41 +262,19 @@ public class FlinkActionsE2eTest extends E2eTestBase {
                 "CREATE TABLE IF NOT EXISTS T (\n"
                         + "    k INT,\n"
                         + "    v STRING,\n"
-                        + "    last_action STRING,\n"
-                        + "    dt STRING,\n"
-                        + "    PRIMARY KEY (k, dt) NOT ENFORCED\n"
-                        + ") PARTITIONED BY (dt);";
+                        + "    PRIMARY KEY (k) NOT ENFORCED\n"
+                        + ");\n";
 
-        String insertToT =
-                "INSERT INTO T VALUES"
-                        + "(1, 'v_1', 'creation', '02-27'),"
-                        + "(2, 'v_2', 'creation', '02-27'),"
-                        + "(3, 'v_3', 'creation', '02-27'),"
-                        + "(4, 'v_4', 'creation', '02-27'),"
-                        + "(5, 'v_5', 'creation', '02-28'),"
-                        + "(6, 'v_6', 'creation', '02-28'),"
-                        + "(7, 'v_7', 'creation', '02-28'),"
-                        + "(8, 'v_8', 'creation', '02-28'),"
-                        + "(9, 'v_9', 'creation', '02-28'),"
-                        + "(10, 'v_10', 'creation', '02-28');\n";
+        String insertToT = "INSERT INTO T VALUES (1, 'Hello'), (2, 'World');\n";
 
         String tableSDdl =
                 "CREATE TABLE IF NOT EXISTS S (\n"
                         + "    k INT,\n"
                         + "    v STRING,\n"
-                        + "    dt STRING,\n"
-                        + "    PRIMARY KEY (k, dt) NOT ENFORCED\n"
-                        + ") PARTITIONED BY (dt);";
+                        + "    PRIMARY KEY (k) NOT ENFORCED\n"
+                        + ");\n";
 
-        String insertToS =
-                "INSERT INTO S VALUES"
-                        + "(1, 'v_1', '02-27'),"
-                        + "(4, CAST (NULL AS STRING), '02-27'),"
-                        + "(7, 'Seven', '02-28'),"
-                        + "(8, CAST (NULL AS STRING), '02-28'),"
-                        + "(8, 'v_8', '02-29'),"
-                        + "(11, 'v_11', '02-29'),"
-                        + "(12, 'v_12', '02-29');\n";
+        String insertToS = "INSERT INTO S VALUES (1, 'Hi');\n";
 
         runSql(
                 "SET 'table.dml-sync' = 'true';\n" + insertToT + insertToS,
@@ -326,19 +304,11 @@ public class FlinkActionsE2eTest extends E2eTestBase {
                         "--using-table",
                         "S",
                         "--on",
-                        "T.k=S.k AND T.dt=S.dt",
+                        "T.k=S.k",
                         "--merge-actions",
-                        "matched-upsert,matched-delete,not-matched-insert",
-                        "--matched-upsert-condition",
-                        "T.v <> S.v AND S.v IS NOT NULL",
+                        "matched-upsert",
                         "--matched-upsert-set",
-                        "v = S.v, last_action = 'matched_upsert'",
-                        "--matched-delete-condition",
-                        "S.v IS NULL",
-                        "--not-matched-insert-condition",
-                        "S.k < 12",
-                        "--not-matched-insert-values",
-                        "S.k, S.v, 'insert', S.dt");
+                        "v = S.v");
 
         LOG.info(execResult.getStdout());
         LOG.info(execResult.getStderr());
@@ -349,20 +319,10 @@ public class FlinkActionsE2eTest extends E2eTestBase {
                 catalogDdl,
                 useCatalogCmd,
                 tableTDdl,
-                createResultSink("result1", "k INT, v STRING, last_action STRING, dt STRING"));
+                createResultSink("result1", "k INT, v STRING"));
 
         // check the left data
-        checkResult(
-                "1, v_1, creation, 02-27",
-                "2, v_2, creation, 02-27",
-                "3, v_3, creation, 02-27",
-                "5, v_5, creation, 02-28",
-                "6, v_6, creation, 02-28",
-                "7, Seven, matched_upsert, 02-28",
-                "8, v_8, insert, 02-29",
-                "9, v_9, creation, 02-28",
-                "10, v_10, creation, 02-28",
-                "11, v_11, insert, 02-29");
+        checkResult("1, Hi", "2, World");
     }
 
     private void runSql(String sql, String... ddls) throws Exception {