yuxiqian commented on code in PR #3677:
URL: https://github.com/apache/flink-cdc/pull/3677#discussion_r1825331347
##########
flink-cdc-runtime/src/test/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformOperatorTest.java:
##########
@@ -1483,6 +1496,107 @@ void testCastErrorTransform() throws Exception {
.hasRootCauseMessage("For input string: \"1.0\"");
}
+ @Test
+ void testCompareTransform() throws Exception {
+ PostTransformOperator transform =
+ PostTransformOperator.newBuilder()
+ .addTransform(
+ COMPARE_TABLEID.identifier(),
+ "col1, 2.1 > CAST(1 AS DOUBLE) as
numerical_equal,"
Review Comment:
It would be nice if we could construct the test case as follows:
* Create upstream schema containing comparable objects, like `(id INT, c1
FLOAT, c2 DOUBLE, c3 TIMESTAMP, ...)`
* Write projection expressions like `id, c1 < 5, c2 > 2.5, c3 <=
TO_TIMESTAMP('2024-01-01 00:00:00') ...`
* Post multiple rows into test harness, and checking if results are as
expected. For example, row `(1, 4, 3.5, 2023-01-01)` should yield `(1, true,
true, true)` and row `(2, 10, 0, '2024-11-01)` should yield `(2, false, false,
false)`.
* Some comparison test with `NULL` would be nice, too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]