This is an automated email from the ASF dual-hosted git repository.
leonard pushed a commit to branch release-1.17
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.17 by this push:
new 9080c7d256a [FLINK-30025][table][tests] Fix unstable tests by
removing "-" and " " from table header of operator IDs
9080c7d256a is described below
commit 9080c7d256afb2d45201e528e2d26c554043d50d
Author: Shengkai <[email protected]>
AuthorDate: Mon Mar 13 15:26:46 2023 +0800
[FLINK-30025][table][tests] Fix unstable tests by removing "-" and " "
from table header of operator IDs
This closes #22164.
Co-authored-by: jingge <[email protected]>
---
.../flink/table/client/cli/CliClientITCase.java | 11 ++++++++++
.../src/test/resources/sql/table.q | 24 +++++++++++-----------
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git
a/flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliClientITCase.java
b/flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliClientITCase.java
index a0e748732c7..10341326747 100644
---
a/flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliClientITCase.java
+++
b/flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/cli/CliClientITCase.java
@@ -378,6 +378,17 @@ class CliClientITCase {
Result result = results.get(i);
String content =
TableTestUtil.replaceNodeIdInOperator(removeExecNodeId(result.content));
+
+ int removedChatNumber = result.content.length() -
content.length();
+ String borderLineStart = "+-";
+ String columnStart = "|";
+ for (int j = 0; j < removedChatNumber; j++) {
+ borderLineStart += "-";
+ columnStart += " ";
+ }
+ content = content.replaceAll("\\" + borderLineStart, "+-");
+ content = content.replace(columnStart, "|");
+
out.append(content).append(result.highestTag.tag).append("\n");
}
}
diff --git a/flink-table/flink-sql-client/src/test/resources/sql/table.q
b/flink-table/flink-sql-client/src/test/resources/sql/table.q
index 790f60e4435..353f120f1ae 100644
--- a/flink-table/flink-sql-client/src/test/resources/sql/table.q
+++ b/flink-table/flink-sql-client/src/test/resources/sql/table.q
@@ -1058,9 +1058,9 @@ Sink(table=[default_catalog.default_database.orders2],
fields=[user, product, am
# test explain insert with json format
explain json_execution_plan insert into orders2 select `user`, product,
amount, ts from orders;
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
-|
[...]
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
+|
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
| == Abstract Syntax Tree ==
LogicalSink(table=[default_catalog.default_database.orders2], fields=[user,
product, amount, ts])
+- LogicalProject(user=[$0], product=[$1], amount=[$2], ts=[$3])
@@ -1121,15 +1121,15 @@ Sink(table=[default_catalog.default_database.orders2],
fields=[user, product, am
} ]
} ]
} |
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
1 row in set
!ok
# test explain select with json format
explain json_execution_plan select `user`, product from orders;
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
-|
[...]
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
+|
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
| == Abstract Syntax Tree ==
LogicalProject(user=[$0], product=[$1])
+- LogicalWatermarkAssigner(rowtime=[ts], watermark=[-($3, 1000:INTERVAL
SECOND)])
@@ -1191,7 +1191,7 @@ Calc(select=[user, product])
} ]
} ]
} |
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
1 row in set
!ok
@@ -1286,9 +1286,9 @@ GroupAggregate(select=[SUM(amount) AS revenue,
COUNT(DISTINCT user) AS buyer_cnt
# test explain select with all details
explain changelog_mode, estimated_cost, plan_advice, json_execution_plan
select `user`, product from orders;
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
-|
[...]
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
+|
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
| == Abstract Syntax Tree ==
LogicalProject(user=[$0], product=[$1])
+- LogicalWatermarkAssigner(rowtime=[ts], watermark=[-($3, 1000:INTERVAL
SECOND)])
@@ -1352,6 +1352,6 @@ Calc(select=[user, product])
} ]
} ]
} |
-+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
1 row in set
!ok