lincoln-lil commented on code in PR #23478:
URL: https://github.com/apache/flink/pull/23478#discussion_r1353989534
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala:
##########
@@ -488,6 +488,18 @@ object ScalarOperatorGens {
else if (isNumeric(left.resultType) && isNumeric(right.resultType)) {
generateComparison(ctx, "!=", left, right, resultType)
}
+ // support date/time/timestamp not equalTo string.
+ else if (
+ (isTimePoint(left.resultType) && isCharacterString(right.resultType)) ||
Review Comment:
Can we add optimizations for string literals similar to the handling of
`generateEquals`?
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/ScalarOperatorsTest.scala:
##########
@@ -228,6 +228,15 @@ class ScalarOperatorsTest extends ScalarOperatorsTestBase {
testSqlApi("uuid() = cast(f22 as timestamp_ltz)", "NULL")
}
+ @Test
+ def testTimePointTypeNotEqualsStringType(): Unit = {
+ testSqlApi("f22 = '1996-11-10 12:34:56'", "TRUE")
Review Comment:
I see that the datetime family contains 5 datatypes(see
`org.apache.flink.table.types.logical.LogicalTypeRoot`), so it is recommended
to add more tests for complete coverage of the datatypes
--
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]