Reading the data written to s3 by Amazon Kinesis Firehose stream

后端 未结 9 2024
感情败类
感情败类 2021-02-18 15:17

I am writing record to Kinesis Firehose stream that is eventually written to a S3 file by Amazon Kinesis Firehose.

My record object looks like

ItemPurcha         


        
9条回答
  •  我在风中等你
    2021-02-18 15:40

    I've had the same issue.

    It would have been better if AWS allowed us to set a delimiter but we can do it on our own.

    In my use case, I've been listening on a stream of tweets, and once receiving a new tweet I immediately put it to Firehose.

    This, of course, resulted in a 1-line file which could not be parsed.

    So, to solve this, I have concatenated the tweet's JSON with a \n. This, in turn, let me use some packages that can output lines when reading stream contents, and parse the file easily.

    Hope this helps you.

提交回复
热议问题