@@ -225,7 +225,7 @@ impl PartitionStore {
225225 pub async fn set_unassigned_partitions (
226226 & self ,
227227 table : & TableReference ,
228- partition_values : Vec < HashMap < String , String > > ,
228+ partition_values : Vec < HashMap < String , Option < String > > > ,
229229 partition_expressions : Vec < String > ,
230230 ) -> Result < ( ) > {
231231 let key = normalized_table_name ( table) ;
@@ -664,7 +664,7 @@ mod tests {
664664 }
665665
666666 fn partition_value ( key : & str , val : & str ) -> PartitionValue {
667- HashMap :: from ( [ ( key. to_string ( ) , val. to_string ( ) ) ] )
667+ HashMap :: from ( [ ( key. to_string ( ) , Some ( val. to_string ( ) ) ) ] )
668668 }
669669
670670 #[ tokio:: test]
@@ -702,7 +702,7 @@ mod tests {
702702 metadata
703703 . partitions
704704 . iter ( )
705- . find ( |p| p. partition_value . get ( "bucket(3, id)" ) == Some ( & val. to_string ( ) ) )
705+ . find ( |p| p. partition_value . get ( "bucket(3, id)" ) == Some ( & Some ( val. to_string ( ) ) ) )
706706 . expect ( "partition not found" )
707707 } ;
708708
@@ -786,14 +786,14 @@ mod tests {
786786 let east = metadata
787787 . partitions
788788 . iter ( )
789- . find ( |p| p. partition_value . get ( "region" ) == Some ( & "us-east" . to_string ( ) ) )
789+ . find ( |p| p. partition_value . get ( "region" ) == Some ( & Some ( "us-east" . to_string ( ) ) ) )
790790 . expect ( "us-east" ) ;
791791 assert ! ( east. is_assigned_to( "executor-1" ) ) ;
792792
793793 let west = metadata
794794 . partitions
795795 . iter ( )
796- . find ( |p| p. partition_value . get ( "region" ) == Some ( & "us-west" . to_string ( ) ) )
796+ . find ( |p| p. partition_value . get ( "region" ) == Some ( & Some ( "us-west" . to_string ( ) ) ) )
797797 . expect ( "us-west" ) ;
798798 assert ! ( west. is_assigned_to( "executor-2" ) ) ;
799799 }
@@ -830,12 +830,12 @@ mod tests {
830830 . await
831831 . expect ( "should initialize" ) ;
832832
833- let pv = HashMap :: from ( [ ( "region" . to_string ( ) , "us-east-1" . to_string ( ) ) ] ) ;
833+ let pv = HashMap :: from ( [ ( "region" . to_string ( ) , Some ( "us-east-1" . to_string ( ) ) ) ] ) ;
834834 pm. set_unassigned_partitions ( & source, vec ! [ pv] , vec ! [ ] )
835835 . await
836836 . expect ( "should set partitions" ) ;
837837 let partition_value: PartitionValue =
838- HashMap :: from ( [ ( "region" . to_string ( ) , "us-east-1" . to_string ( ) ) ] ) ;
838+ HashMap :: from ( [ ( "region" . to_string ( ) , Some ( "us-east-1" . to_string ( ) ) ) ] ) ;
839839 pm. assign_partition ( & source, & partition_value, "executor-1" )
840840 . await
841841 . expect ( "should assign" ) ;
@@ -890,7 +890,7 @@ mod tests {
890890 . await
891891 . expect ( "should initialize target" ) ;
892892
893- let pv = HashMap :: from ( [ ( "region" . to_string ( ) , "eu-west-1" . to_string ( ) ) ] ) ;
893+ let pv = HashMap :: from ( [ ( "region" . to_string ( ) , Some ( "eu-west-1" . to_string ( ) ) ) ] ) ;
894894 pm. set_unassigned_partitions ( & source, vec ! [ pv] , vec ! [ ] )
895895 . await
896896 . expect ( "should set partitions" ) ;
@@ -959,7 +959,7 @@ mod tests {
959959 . await
960960 . expect ( "should initialize" ) ;
961961
962- let pv = HashMap :: from ( [ ( "org_id" . to_string ( ) , "test_org_name" . to_string ( ) ) ] ) ;
962+ let pv = HashMap :: from ( [ ( "org_id" . to_string ( ) , Some ( "test_org_name" . to_string ( ) ) ) ] ) ;
963963 pm. set_unassigned_partitions ( & bare, vec ! [ pv] , vec ! [ ] )
964964 . await
965965 . expect ( "should set partitions" ) ;
@@ -973,7 +973,7 @@ mod tests {
973973 assert_eq ! ( meta_via_full. partitions. len( ) , 1 ) ;
974974
975975 let partition_value: PartitionValue =
976- HashMap :: from ( [ ( "org_id" . to_string ( ) , "test_org_name" . to_string ( ) ) ] ) ;
976+ HashMap :: from ( [ ( "org_id" . to_string ( ) , Some ( "test_org_name" . to_string ( ) ) ) ] ) ;
977977 pm. assign_partition ( & full, & partition_value, "executor-1" )
978978 . await
979979 . expect ( "should assign via fully qualified ref" ) ;
@@ -999,7 +999,7 @@ mod tests {
999999 acc. initialize_metadata ( & table, vec ! [ "region" . to_string( ) ] )
10001000 . await
10011001 . expect ( "init" ) ;
1002- let pv = HashMap :: from ( [ ( "region" . to_string ( ) , "us-east-1" . to_string ( ) ) ] ) ;
1002+ let pv = HashMap :: from ( [ ( "region" . to_string ( ) , Some ( "us-east-1" . to_string ( ) ) ) ] ) ;
10031003 acc. set_unassigned_partitions ( & table, vec ! [ pv. clone( ) ] , vec ! [ ] )
10041004 . await
10051005 . expect ( "set" ) ;
@@ -1018,8 +1018,8 @@ mod tests {
10181018 pm. initialize_metadata ( & table, vec ! [ "region" . to_string( ) ] )
10191019 . await
10201020 . expect ( "init" ) ;
1021- let values: Vec < HashMap < String , String > > = ( 0 ..50 )
1022- . map ( |i| HashMap :: from ( [ ( "region" . to_string ( ) , format ! ( "r-{i}" ) ) ] ) )
1021+ let values: Vec < HashMap < String , Option < String > > > = ( 0 ..50 )
1022+ . map ( |i| HashMap :: from ( [ ( "region" . to_string ( ) , Some ( format ! ( "r-{i}" ) ) ) ] ) )
10231023 . collect ( ) ;
10241024 pm. set_unassigned_partitions ( & table, values. clone ( ) , vec ! [ ] )
10251025 . await
0 commit comments