带有 flume 的 Unicode 字符

Unicode character with flume

我正在尝试使用 flume 将 CSV 文件放入 HDFS,文件还包含一些 unicode 字符。

文件在 HDFS 中后,我尝试查看内容,但无法正确查看记录。

文件内容

Name    age  sal    msg

Abc     21  1200    Lukè éxample àpple

Xyz     23  1400    er stîget ûf mit grôzer

控制台输出

我做到了hdfs dfs -get /flume/events/csv/events.1234567

下面是输出

Name,age,sal,msg

Abc,21,1200,Luk��xample��pple

Xyz,23,1400,er st�get �f mit gr�zer

flume 支持 Unicode 字符吗?如果不是如何处理

是 Flume 支持 Unicode 字符。您可以使用 flume 读取您的 Unicode 文件并将数据传输到 HDFS。这看起来像 DataStream 的其他 issue.Change hdfs.fileType 并查看您是否可以正确读取输出。

a1.sources = r1
a1.channels = c1
a1.sinks = k1

#source
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /root/user/shashi/unicode/french.txt
a1.sources.r1.restart = true

#sink

a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = /flume/events/
a1.sinks.k1.hdfs.filePrefix = events-
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.fileType = DataStream
#channel
a1.channels.c1.type = memory

#connect
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

这是我用过的一个smaple配置。