考慮以下幾點:如何將記錄格式化爲AWS Kinesis Firehose到Redshift?
- 在紅移的表稱爲「人」有場ID,姓名和年齡
- 稱爲「人」被配置爲寫「人」表室壁運動流水流並且'Redshift table columns'的值是'id,name,age'
不清楚如何格式化'Data'blob。下面是代碼的樣子與製表符分隔的數據爲例:
let AWS = require('aws-sdk');
let firehose = new AWS.Firehose();
let params = {
DeliveryStreamName: 'people',
// id,name,age
Records: [{Data: '4ccf6d3a-acdf-11e5-ad54-28cfe91fa8f1\tBob\tSmith'}]
};
firehose.putRecordBatch(params, (err, result) => {
console.log(err || result);
});
這裏有一些我已經檢查了文檔的:
- http://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html
- http://docs.aws.amazon.com/firehose/latest/dev/writing-with-sdk.html
- http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Firehose.html#putRecordBatch-property