@@ -59,7 +59,7 @@ func (s *Server) Migrate(ctx context.Context, req *pb.Migrate_Request) (*pb.Migr
5959 if err := json .Unmarshal (req .Tables , & tablesV2 ); err != nil {
6060 return nil , status .Errorf (codes .InvalidArgument , "failed to unmarshal tables: %v" , err )
6161 }
62- tables := TablesV2ToV3 (tablesV2 )
62+ tables := TablesV2ToV3 (tablesV2 ). FlattenTables ()
6363 SetDestinationManagedCqColumns (tables )
6464 s .setPKsForTables (tables )
6565
@@ -97,7 +97,7 @@ func (s *Server) Write2(msg pb.Destination_Write2Server) error {
9797 return status .Errorf (codes .InvalidArgument , "failed to unmarshal source spec: %v" , err )
9898 }
9999 }
100- tables := TablesV2ToV3 (tablesV2 )
100+ tables := TablesV2ToV3 (tablesV2 ). FlattenTables ()
101101 syncTime := r .Timestamp .AsTime ()
102102 SetDestinationManagedCqColumns (tables )
103103 s .setPKsForTables (tables )
@@ -201,12 +201,8 @@ func (s *Server) DeleteStale(ctx context.Context, req *pb.DeleteStale_Request) (
201201 if err := json .Unmarshal (req .Tables , & tablesV2 ); err != nil {
202202 return nil , status .Errorf (codes .InvalidArgument , "failed to unmarshal tables: %v" , err )
203203 }
204- tables := TablesV2ToV3 (tablesV2 )
204+ tables := TablesV2ToV3 (tablesV2 ). FlattenTables ()
205205 SetDestinationManagedCqColumns (tables )
206- schemas := make (schemav2.Schemas , len (tables .FlattenTables ()))
207- for i , table := range tables .FlattenTables () {
208- schemas [i ] = table .ToArrowSchema ()
209- }
210206 if err := s .Plugin .DeleteStale (ctx , tables , req .Source , req .Timestamp .AsTime ()); err != nil {
211207 return nil , err
212208 }
0 commit comments