I am spooling directory with Flume and uploading files into hdfs. These are txt/csv files, and I want them in that format in hdfs. But Flume is loading them as binary files...
Here is my config:
tier1.sources = source1
tier1.channels = channel1
tier1.sinks = sink1
tier1.sources.source1.type = spooldir
tier1.sources.source1.channels = channel1
tier1.sources.source1.spoolDir = /var/data
tier1.sources.source1.fileHeader = false
tier1.sources.source1.deletePolicy = immediate
tier1.channels.channel1.type = memory
tier1.sinks.sink1.type = hdfs
tier1.sinks.sink1.channel = channel1
tier1.sinks.sink1.hdfs.path = /user/hdfs/%y-%m-%d/
tier1.sinks.sink1.hdfs.writeFormat=Text
tier1.sinks.sink1.hdfs.useLocalTimeStamp = true
tier1.sinks.sink1.hdfs.rollInterval = 30
tier1.channels.channel1.capacity = 100
What should I change to make Flume load txt files as txt files?
this should solve your problem:
tier1.sinks.sink1.hdfs.fileType = DataStream
tier1.sinks.sink1.hdfs.writeFormat = Text