@@ -702,8 +702,9 @@ mod tests {
702702 use crate :: arrow:: schema_to_arrow_schema;
703703 use crate :: io:: FileIOBuilder ;
704704 use crate :: spec:: { PrimitiveLiteral , Struct , * } ;
705- use crate :: writer:: file_writer:: location_generator:: DefaultFileNameGenerator ;
706- use crate :: writer:: file_writer:: location_generator:: test:: MockLocationGenerator ;
705+ use crate :: writer:: file_writer:: location_generator:: {
706+ DefaultFileNameGenerator , DefaultLocationGenerator ,
707+ } ;
707708 use crate :: writer:: tests:: check_parquet_data_file;
708709
709710 fn schema_for_all_type ( ) -> Schema {
@@ -862,8 +863,9 @@ mod tests {
862863 async fn test_parquet_writer ( ) -> Result < ( ) > {
863864 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
864865 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
865- let location_gen =
866- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
866+ let location_gen = DefaultLocationGenerator :: with_data_location (
867+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
868+ ) ;
867869 let file_name_gen =
868870 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
869871
@@ -933,8 +935,9 @@ mod tests {
933935 async fn test_parquet_writer_with_complex_schema ( ) -> Result < ( ) > {
934936 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
935937 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
936- let location_gen =
937- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
938+ let location_gen = DefaultLocationGenerator :: with_data_location (
939+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
940+ ) ;
938941 let file_name_gen =
939942 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
940943
@@ -1158,8 +1161,9 @@ mod tests {
11581161 async fn test_all_type_for_write ( ) -> Result < ( ) > {
11591162 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
11601163 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1161- let loccation_gen =
1162- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1164+ let loccation_gen = DefaultLocationGenerator :: with_data_location (
1165+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1166+ ) ;
11631167 let file_name_gen =
11641168 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
11651169
@@ -1401,8 +1405,9 @@ mod tests {
14011405 async fn test_decimal_bound ( ) -> Result < ( ) > {
14021406 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
14031407 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1404- let loccation_gen =
1405- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1408+ let loccation_gen = DefaultLocationGenerator :: with_data_location (
1409+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1410+ ) ;
14061411 let file_name_gen =
14071412 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
14081413
@@ -1654,8 +1659,9 @@ mod tests {
16541659 async fn test_empty_write ( ) -> Result < ( ) > {
16551660 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
16561661 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1657- let location_gen =
1658- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1662+ let location_gen = DefaultLocationGenerator :: with_data_location (
1663+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1664+ ) ;
16591665 let file_name_gen =
16601666 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
16611667
@@ -1709,8 +1715,9 @@ mod tests {
17091715 async fn test_nan_val_cnts_primitive_type ( ) -> Result < ( ) > {
17101716 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
17111717 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1712- let location_gen =
1713- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1718+ let location_gen = DefaultLocationGenerator :: with_data_location (
1719+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1720+ ) ;
17141721 let file_name_gen =
17151722 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
17161723
@@ -1797,8 +1804,9 @@ mod tests {
17971804 async fn test_nan_val_cnts_struct_type ( ) -> Result < ( ) > {
17981805 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
17991806 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1800- let location_gen =
1801- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1807+ let location_gen = DefaultLocationGenerator :: with_data_location (
1808+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1809+ ) ;
18021810 let file_name_gen =
18031811 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
18041812
@@ -1937,8 +1945,9 @@ mod tests {
19371945 async fn test_nan_val_cnts_list_type ( ) -> Result < ( ) > {
19381946 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
19391947 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
1940- let location_gen =
1941- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
1948+ let location_gen = DefaultLocationGenerator :: with_data_location (
1949+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
1950+ ) ;
19421951 let file_name_gen =
19431952 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
19441953
@@ -2139,8 +2148,9 @@ mod tests {
21392148 async fn test_nan_val_cnts_map_type ( ) -> Result < ( ) > {
21402149 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
21412150 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
2142- let location_gen =
2143- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
2151+ let location_gen = DefaultLocationGenerator :: with_data_location (
2152+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
2153+ ) ;
21442154 let file_name_gen =
21452155 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
21462156
@@ -2295,8 +2305,9 @@ mod tests {
22952305 async fn test_write_empty_parquet_file ( ) {
22962306 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
22972307 let file_io = FileIOBuilder :: new_fs_io ( ) . build ( ) . unwrap ( ) ;
2298- let location_gen =
2299- MockLocationGenerator :: new ( temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ) ;
2308+ let location_gen = DefaultLocationGenerator :: with_data_location (
2309+ temp_dir. path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
2310+ ) ;
23002311 let file_name_gen =
23012312 DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
23022313
0 commit comments