[
https://issues.apache.org/jira/browse/FLINK-19587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17221965#comment-17221965
]
Jark Wu edited comment on FLINK-19587 at 10/29/20, 4:22 AM:
------------------------------------------------------------
Fixed in:
- master: d9b0ac97ee4675aebdab1592af663b95fdc5051b
- 1.11: 053f03c8ea1c7e1e93d41e87606799f4f844c719
was (Author: jark):
Fixed in:
- master: d9b0ac97ee4675aebdab1592af663b95fdc5051b
- 1.11: TODO
> Error result when casting binary type as varchar
> ------------------------------------------------
>
> Key: FLINK-19587
> URL: https://issues.apache.org/jira/browse/FLINK-19587
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 1.11.0
> Reporter: hailong wang
> Assignee: hailong wang
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.12.0, 1.11.3
>
>
> The result is error when casting binary type as varchar type.
> For example,
> {code:java}
> @Test
> def testCast1(): Unit = {
> testSqlApi(
> "CAST(X'68656c6c6f' as varchar)",
> "hello")
> }
> {code}
> The result is
> {code:java}
> Expected :hello
> Actual :[B@57fae983
> {code}
> It is right as follow,
> {code:java}
> @Test
> def testCast(): Unit = {
> testSqlApi(
> "CAST(CAST(X'68656c6c6f' as varbinary) as varchar)",
> "hello")
> }
> {code}
> We just need to change
> {code:java}
> case (VARBINARY, VARCHAR | CHAR){code}
> to
> {code:java}
> case (BINARY | VARBINARY, VARCHAR | CHAR)
> {code}
> in ScalarOperatorGens#generateCast.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)