You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by LakeShen <sh...@gmail.com> on 2020/09/03 09:03:56 UTC

Flink SQL 任务乱码问题

Hi 社区,

   我的一个 Flink SQL 任务,版本为 1.10,代码中使用了中文值,具体如下:

 select xxx, case when a = 'a' then '你好'  when a = 'b' then '你好呀' end as va
from xxx ;

  然后会把这个结果输出,最后发现 va 的值乱码了,也就是中文乱码。

目前有什么比较好的解决方法吗。

Best,
LakeShen

Re: Flink SQL任务乱码问题

Posted by Danny Chan <yu...@gmail.com>.
SQL 文本是什么编码 ?有尝试过 UTF8 编码 ?

Best,
Danny Chan
在 2020年9月3日 +0800 PM5:04,LakeShen <sh...@gmail.com>,写道:
> Hi 社区,
>
> 我的一个 Flink SQL 任务,版本为 1.10,代码中使用了中文值,具体如下:
>
> select xxx, case when a = 'a' then '你好' when a = 'b' then '你好呀' end as va
> from xxx ;
>
> 然后会把这个结果输出,最后发现 va 的值乱码了,也就是中文乱码。
>
> 目前有什么比较好的解决方法吗。
>
> Best,
> LakeShen