@@ -702,8 +702,9 @@ mod tests {
702
702
use crate :: arrow:: schema_to_arrow_schema;
703
703
use crate :: io:: FileIOBuilder ;
704
704
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
+ } ;
707
708
use crate :: writer:: tests:: check_parquet_data_file;
708
709
709
710
fn schema_for_all_type ( ) -> Schema {
@@ -862,8 +863,9 @@ mod tests {
862
863
async fn test_parquet_writer ( ) -> Result < ( ) > {
863
864
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
864
865
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
+ ) ;
867
869
let file_name_gen =
868
870
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
869
871
@@ -933,8 +935,9 @@ mod tests {
933
935
async fn test_parquet_writer_with_complex_schema ( ) -> Result < ( ) > {
934
936
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
935
937
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
+ ) ;
938
941
let file_name_gen =
939
942
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
940
943
@@ -1158,8 +1161,9 @@ mod tests {
1158
1161
async fn test_all_type_for_write ( ) -> Result < ( ) > {
1159
1162
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1160
1163
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
+ ) ;
1163
1167
let file_name_gen =
1164
1168
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1165
1169
@@ -1401,8 +1405,9 @@ mod tests {
1401
1405
async fn test_decimal_bound ( ) -> Result < ( ) > {
1402
1406
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1403
1407
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
+ ) ;
1406
1411
let file_name_gen =
1407
1412
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1408
1413
@@ -1654,8 +1659,9 @@ mod tests {
1654
1659
async fn test_empty_write ( ) -> Result < ( ) > {
1655
1660
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1656
1661
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
+ ) ;
1659
1665
let file_name_gen =
1660
1666
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1661
1667
@@ -1709,8 +1715,9 @@ mod tests {
1709
1715
async fn test_nan_val_cnts_primitive_type ( ) -> Result < ( ) > {
1710
1716
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1711
1717
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
+ ) ;
1714
1721
let file_name_gen =
1715
1722
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1716
1723
@@ -1797,8 +1804,9 @@ mod tests {
1797
1804
async fn test_nan_val_cnts_struct_type ( ) -> Result < ( ) > {
1798
1805
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1799
1806
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
+ ) ;
1802
1810
let file_name_gen =
1803
1811
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1804
1812
@@ -1937,8 +1945,9 @@ mod tests {
1937
1945
async fn test_nan_val_cnts_list_type ( ) -> Result < ( ) > {
1938
1946
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
1939
1947
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
+ ) ;
1942
1951
let file_name_gen =
1943
1952
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
1944
1953
@@ -2139,8 +2148,9 @@ mod tests {
2139
2148
async fn test_nan_val_cnts_map_type ( ) -> Result < ( ) > {
2140
2149
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
2141
2150
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
+ ) ;
2144
2154
let file_name_gen =
2145
2155
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
2146
2156
@@ -2295,8 +2305,9 @@ mod tests {
2295
2305
async fn test_write_empty_parquet_file ( ) {
2296
2306
let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
2297
2307
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
+ ) ;
2300
2311
let file_name_gen =
2301
2312
DefaultFileNameGenerator :: new ( "test" . to_string ( ) , None , DataFileFormat :: Parquet ) ;
2302
2313
0 commit comments