@@ -12,7 +12,6 @@ import (
1212 "github.com/PeerDB-io/peerdb/flow/connectors/utils"
1313 "github.com/PeerDB-io/peerdb/flow/generated/protos"
1414 "github.com/PeerDB-io/peerdb/flow/internal"
15- chinternal "github.com/PeerDB-io/peerdb/flow/internal/clickhouse"
1615 "github.com/PeerDB-io/peerdb/flow/model"
1716 "github.com/PeerDB-io/peerdb/flow/model/qvalue"
1817 peerdb_clickhouse "github.com/PeerDB-io/peerdb/flow/pkg/clickhouse"
@@ -132,7 +131,7 @@ func (c *ClickHouseConnector) syncRecordsViaAvro(
132131 }
133132 warnings := numericTruncator .Warnings ()
134133
135- if err := c .ReplayTableSchemaDeltas (ctx , req .Env , req .FlowJobName , req .TableMappings , req .Records .SchemaDeltas , req . Version ); err != nil {
134+ if err := c .ReplayTableSchemaDeltas (ctx , req .Env , req .FlowJobName , req .TableMappings , req .Records .SchemaDeltas ); err != nil {
136135 return nil , fmt .Errorf ("failed to sync schema changes: %w" , err )
137136 }
138137
@@ -166,7 +165,6 @@ func (c *ClickHouseConnector) ReplayTableSchemaDeltas(
166165 flowJobName string ,
167166 tableMappings []* protos.TableMapping ,
168167 schemaDeltas []* protos.TableSchemaDelta ,
169- internalVersion uint32 ,
170168) error {
171169 if len (schemaDeltas ) == 0 {
172170 return nil
@@ -190,7 +188,7 @@ func (c *ClickHouseConnector) ReplayTableSchemaDeltas(
190188 for _ , addedColumn := range schemaDelta .AddedColumns {
191189 qvKind := types .QValueKind (addedColumn .Type )
192190 clickHouseColType , err := qvalue .ToDWHColumnType (
193- ctx , qvKind , env , protos .DBType_CLICKHOUSE , c .chVersion , addedColumn , schemaDelta .NullableEnabled , internalVersion ,
191+ ctx , qvKind , env , protos .DBType_CLICKHOUSE , c .chVersion , addedColumn , schemaDelta .NullableEnabled ,
194192 )
195193 if err != nil {
196194 return fmt .Errorf ("failed to convert column type %s to ClickHouse type: %w" , addedColumn .Type , err )
@@ -230,8 +228,7 @@ func (c *ClickHouseConnector) RenameTables(
230228 req * protos.RenameTablesInput ,
231229) (* protos.RenameTablesOutput , error ) {
232230 onCluster := c .onCluster ()
233- dropTableSQLWithCHSetting := dropTableIfExistsSQL +
234- chinternal .NewCHSettingsString (c .chVersion , chinternal .SettingMaxTableSizeToDrop , "0" )
231+ dropTableSQLWithCHSetting := dropTableIfExistsSQL + NewCHSettingsString (c .chVersion , SettingMaxTableSizeToDrop , "0" )
235232 for _ , renameRequest := range req .RenameTableOptions {
236233 if renameRequest .CurrentName == renameRequest .NewName {
237234 c .logger .Info ("table rename is nop, probably Null table engine, skipping rename for it" ,
@@ -305,8 +302,7 @@ func (c *ClickHouseConnector) SyncFlowCleanup(ctx context.Context, jobName strin
305302 // delete raw table if exists
306303 rawTableIdentifier := c .GetRawTableName (jobName )
307304 onCluster := c .onCluster ()
308- dropTableSQLWithCHSetting := dropTableIfExistsSQL +
309- chinternal .NewCHSettingsString (c .chVersion , chinternal .SettingMaxTableSizeToDrop , "0" )
305+ dropTableSQLWithCHSetting := dropTableIfExistsSQL + NewCHSettingsString (c .chVersion , SettingMaxTableSizeToDrop , "0" )
310306 if err := c .execWithLogging (ctx ,
311307 fmt .Sprintf (dropTableSQLWithCHSetting , peerdb_clickhouse .QuoteIdentifier (rawTableIdentifier ), onCluster ),
312308 ); err != nil {
0 commit comments