Skip to content

Commit 33465f7

Browse files
patelpratik4jobPatelbmoffatt
authored
firehose support dynamic partitioning (#395)
* added metadata in firehose response record to support dynamic partitioning * fixed data type of partitionKeys property * fixed linter errors Co-authored-by: Patel <[email protected]> Co-authored-by: Bryan Moffatt <[email protected]>
1 parent 1f78284 commit 33465f7

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

events/firehose.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ type KinesisFirehoseResponse struct {
3030
}
3131

3232
type KinesisFirehoseResponseRecord struct {
33-
RecordID string `json:"recordId"`
34-
Result string `json:"result"` // The status of the transformation. May be TransformedStateOk, TransformedStateDropped or TransformedStateProcessingFailed
35-
Data []byte `json:"data"`
33+
RecordID string `json:"recordId"`
34+
Result string `json:"result"` // The status of the transformation. May be TransformedStateOk, TransformedStateDropped or TransformedStateProcessingFailed
35+
Data []byte `json:"data"`
36+
Metadata KinesisFirehoseResponseRecordMetadata `json:"metadata"`
37+
}
38+
39+
type KinesisFirehoseResponseRecordMetadata struct {
40+
PartitionKeys map[string]string `json:"partitionKeys"`
3641
}
3742

3843
type KinesisFirehoseRecordMetadata struct {

events/testdata/kinesis-firehose-response.json

+19-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@
33
{
44
"data": "SGVsbG8gV29ybGQ=",
55
"recordId": "record1",
6-
"result": "TRANSFORMED_STATE_OK"
6+
"result": "TRANSFORMED_STATE_OK",
7+
"metadata": {
8+
"partitionKeys": {}
9+
}
710
},
811
{
912
"data": "SGVsbG8gV29ybGQ=",
1013
"recordId": "record2",
11-
"result": "TRANSFORMED_STATE_DROPPED"
14+
"result": "TRANSFORMED_STATE_DROPPED",
15+
"metadata": {
16+
"partitionKeys": {}
17+
}
18+
},
19+
{
20+
"data": "SGVsbG8gV29ybGQ=",
21+
"recordId": "record3",
22+
"result": "TransformedStateOk",
23+
"metadata": {
24+
"partitionKeys": {
25+
"iamKey1": "iamValue1",
26+
"iamKey2": "iamValue2"
27+
}
28+
}
1229
}
1330
]
1431
}

0 commit comments

Comments
 (0)