开发者社区> 问答> 正文

Flink SQL csv格式分隔符设置失败怎么解决?

Flink 版本:1.11.1 我的flink sql: create table stream_tmp.t1( log string) with ( 'connector' = 'kafka', 'topic' = 't1', 'properties.bootstrap.servers' = 'xxxxx:9092', 'properties.group.id' = 'flink_test_01', 'scan.startup.mode' = 'latest-offset', 'format' = 'csv', 'csv.field-delimiter' = '\n'

); 提交到flink sql执行引擎中(获取sql,执行sql内容),报不认识'\n',内容如下: Caused by: org.apache.flink.table.api.ValidationException: Option 'csv.field-delimiter' must be a string with single character, but was: \n at org.apache.flink.formats.csv.CsvFormatFactory.validateCharacterVal(CsvFormatFactory.java:183) at org.apache.flink.formats.csv.CsvFormatFactory.validateFormatOptions(CsvFormatFactory.java:158) at org.apache.flink.formats.csv.CsvFormatFactory.createDecodingFormat(CsvFormatFactory.java:70) at org.apache.flink.table.factories.FactoryUtil$TableFactoryHelper.lambda$discoverOptionalDecodingFormat$1(FactoryUtil.java:430) ... 42 common frames omitted

不明白为什么把'\n'识别成两个字符了*来自志愿者整理的flink邮件归档

展开
收起
JACKJACK 2021-12-08 10:59:36 1762 0
1 条回答
写回答
取消 提交回答
  • 对的是我!

    hi! 改成下面这样: \n => U&'\000A' \t => U&'\0009'*来自志愿者整理的flink邮件归档

    2021-12-08 16:39:23
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载