wuchong commented on a change in pull request #13612:
URL: https://github.com/apache/flink/pull/13612#discussion_r512412637
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/ScalarOperatorsTest.scala
##########
@@ -62,6 +62,26 @@ class ScalarOperatorsTest extends ScalarOperatorsTestBase {
)
}
+ @Test
+ def testCast(): Unit = {
+
+ // binary -> varchar
+ testSqlApi(
+ "CAST (f18 as varchar)",
+ "hello world")
+
+ // varbinary -> varchar
+ testSqlApi(
+ "CAST (f19 as varchar)",
+ "hello flink")
+
+ // null case
+ testSqlApi("CAST (NULL AS INT)", "null")
+ testSqlApi(
+ "CAST (NULL AS VARCHAR) = ''",
+ "null")
Review comment:
Would be better to add a test for cast binary literal to varchar.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]