@@ -577,6 +577,51 @@ func Test_shardTableClients(t *testing.T) {
577577 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
578578 },
579579 },
580+
581+ {
582+ name : "uneven split 1 of 3" ,
583+ tableClients : []tableClient {
584+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
585+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
586+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
587+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
588+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
589+ },
590+ shard : & shard {num : 1 , total : 3 },
591+ expected : []tableClient {
592+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
593+ },
594+ },
595+ {
596+ name : "uneven split 2 of 3" ,
597+ tableClients : []tableClient {
598+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
599+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
600+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
601+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
602+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
603+ },
604+ shard : & shard {num : 2 , total : 3 },
605+ expected : []tableClient {
606+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
607+ },
608+ },
609+ {
610+ name : "uneven split 3 of 3" ,
611+ tableClients : []tableClient {
612+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
613+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
614+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
615+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
616+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
617+ },
618+ shard : & shard {num : 3 , total : 3 },
619+ expected : []tableClient {
620+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
621+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
622+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
623+ },
624+ },
580625 {
581626 name : "more shards than table clients" ,
582627 tableClients : []tableClient {
0 commit comments