From 450645d28740b8181826abf3d941125a96b2adcf Mon Sep 17 00:00:00 2001 From: Andrei Tserakhau Date: Thu, 22 Aug 2024 10:19:07 +0300 Subject: [PATCH] Update model_source.go TRANSFER-650: Add append-only mark for kinesis source It by default updateable, this creates not a pefect DDL for target clickhouse --- .../go/pkg/providers/kinesis/model_source.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/transfer_manager/go/pkg/providers/kinesis/model_source.go b/transfer_manager/go/pkg/providers/kinesis/model_source.go index 80f286ce..a41a3f60 100644 --- a/transfer_manager/go/pkg/providers/kinesis/model_source.go +++ b/transfer_manager/go/pkg/providers/kinesis/model_source.go @@ -3,6 +3,7 @@ package kinesis import ( "github.com/doublecloud/transfer/transfer_manager/go/pkg/abstract" "github.com/doublecloud/transfer/transfer_manager/go/pkg/abstract/model" + "github.com/doublecloud/transfer/transfer_manager/go/pkg/parsers" ) var ( @@ -34,3 +35,15 @@ func (k *KinesisSource) WithDefaults() { } func (k *KinesisSource) IsSource() {} + +func (s *KinesisSource) IsAppendOnly() bool { + if s.ParserConfig == nil { + return true + } else { + parserConfigStruct, _ := parsers.ParserConfigMapToStruct(s.ParserConfig) + if parserConfigStruct == nil { + return true + } + return parserConfigStruct.IsAppendOnly() + } +}