@@ -53,6 +53,53 @@ fn test_user_stage_oss_latest() -> anyhow::Result<()> {
53
53
Ok ( ( ) )
54
54
}
55
55
56
+ #[ test]
57
+ fn test_user_stage_fs_v22 ( ) -> anyhow:: Result < ( ) > {
58
+ // Encoded data of version 21 of user_stage_fs:
59
+ // It is generated with common::test_pb_from_to.
60
+ let user_stage_fs_v22 = vec ! [
61
+ 10 , 17 , 102 , 115 , 58 , 47 , 47 , 100 , 105 , 114 , 47 , 116 , 111 , 47 , 102 , 105 , 108 , 101 , 115 , 26 ,
62
+ 25 , 10 , 23 , 18 , 21 , 10 , 13 , 47 , 100 , 105 , 114 , 47 , 116 , 111 , 47 , 102 , 105 , 108 , 101 , 115 ,
63
+ 160 , 6 , 22 , 168 , 6 , 1 , 34 , 37 , 8 , 1 , 16 , 128 , 8 , 26 , 1 , 124 , 34 , 2 , 47 , 47 , 40 , 2 , 50 , 1 ,
64
+ 92 , 58 , 3 , 114 , 111 , 119 , 66 , 3 , 78 , 97 , 78 , 74 , 2 , 39 , 39 , 160 , 6 , 22 , 168 , 6 , 1 , 42 , 10 ,
65
+ 10 , 3 , 32 , 154 , 5 , 16 , 142 , 8 , 24 , 1 , 50 , 4 , 116 , 101 , 115 , 116 , 160 , 6 , 22 , 168 , 6 , 1 ,
66
+ ] ;
67
+
68
+ let want = mt:: UserStageInfo {
69
+ stage_name : "fs://dir/to/files" . to_string ( ) ,
70
+ stage_type : mt:: StageType :: LegacyInternal ,
71
+ stage_params : mt:: StageParams {
72
+ storage : StorageParams :: Fs ( StorageFsConfig {
73
+ root : "/dir/to/files" . to_string ( ) ,
74
+ } ) ,
75
+ } ,
76
+ file_format_options : mt:: FileFormatOptions {
77
+ format : mt:: StageFileFormatType :: Json ,
78
+ skip_header : 1024 ,
79
+ field_delimiter : "|" . to_string ( ) ,
80
+ record_delimiter : "//" . to_string ( ) ,
81
+ nan_display : "NaN" . to_string ( ) ,
82
+ compression : mt:: StageFileCompression :: Bz2 ,
83
+ escape : "\\ " . to_string ( ) ,
84
+ row_tag : "row" . to_string ( ) ,
85
+ quote : "\' \' " . to_string ( ) ,
86
+ } ,
87
+ copy_options : mt:: CopyOptions {
88
+ on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
89
+ size_limit : 1038 ,
90
+ split_size : 0 ,
91
+ purge : true ,
92
+ single : false ,
93
+ max_file_size : 0 ,
94
+ } ,
95
+ comment : "test" . to_string ( ) ,
96
+ ..Default :: default ( )
97
+ } ;
98
+ common:: test_load_old ( func_name ! ( ) , user_stage_fs_v22. as_slice ( ) , want) ?;
99
+
100
+ Ok ( ( ) )
101
+ }
102
+
56
103
#[ test]
57
104
fn test_user_stage_fs_v21 ( ) -> anyhow:: Result < ( ) > {
58
105
// Encoded data of version 21 of user_stage_fs:
@@ -82,6 +129,7 @@ fn test_user_stage_fs_v21() -> anyhow::Result<()> {
82
129
compression : mt:: StageFileCompression :: Bz2 ,
83
130
escape : "\\ " . to_string ( ) ,
84
131
row_tag : "row" . to_string ( ) ,
132
+ quote : "" . to_string ( ) ,
85
133
} ,
86
134
copy_options : mt:: CopyOptions {
87
135
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -127,6 +175,7 @@ fn test_user_stage_fs_v20() -> anyhow::Result<()> {
127
175
compression : mt:: StageFileCompression :: Bz2 ,
128
176
escape : "\\ " . to_string ( ) ,
129
177
row_tag : "row" . to_string ( ) ,
178
+ quote : "" . to_string ( ) ,
130
179
} ,
131
180
copy_options : mt:: CopyOptions {
132
181
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -173,6 +222,7 @@ fn test_user_stage_fs_v18() -> anyhow::Result<()> {
173
222
row_tag : "" . to_string ( ) ,
174
223
escape : "" . to_string ( ) ,
175
224
compression : mt:: StageFileCompression :: Bz2 ,
225
+ quote : "" . to_string ( ) ,
176
226
} ,
177
227
copy_options : mt:: CopyOptions {
178
228
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -219,6 +269,7 @@ fn test_user_stage_fs_v16() -> anyhow::Result<()> {
219
269
escape : "" . to_string ( ) ,
220
270
compression : mt:: StageFileCompression :: Bz2 ,
221
271
row_tag : "" . to_string ( ) ,
272
+ quote : "" . to_string ( ) ,
222
273
} ,
223
274
copy_options : mt:: CopyOptions {
224
275
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -277,6 +328,7 @@ fn test_user_stage_s3_v16() -> anyhow::Result<()> {
277
328
escape : "" . to_string ( ) ,
278
329
compression : mt:: StageFileCompression :: Bz2 ,
279
330
row_tag : "" . to_string ( ) ,
331
+ quote : "" . to_string ( ) ,
280
332
} ,
281
333
copy_options : mt:: CopyOptions {
282
334
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -329,6 +381,7 @@ fn test_user_stage_gcs_v16() -> anyhow::Result<()> {
329
381
escape : "" . to_string ( ) ,
330
382
compression : mt:: StageFileCompression :: Bz2 ,
331
383
row_tag : "" . to_string ( ) ,
384
+ quote : "" . to_string ( ) ,
332
385
} ,
333
386
copy_options : mt:: CopyOptions {
334
387
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -383,6 +436,7 @@ fn test_user_stage_oss_v16() -> anyhow::Result<()> {
383
436
escape : "" . to_string ( ) ,
384
437
compression : mt:: StageFileCompression :: Bz2 ,
385
438
row_tag : "" . to_string ( ) ,
439
+ quote : "" . to_string ( ) ,
386
440
} ,
387
441
copy_options : mt:: CopyOptions {
388
442
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -439,6 +493,7 @@ fn test_user_stage_oss_v13() -> anyhow::Result<()> {
439
493
escape : "" . to_string ( ) ,
440
494
compression : mt:: StageFileCompression :: Bz2 ,
441
495
row_tag : "" . to_string ( ) ,
496
+ quote : "" . to_string ( ) ,
442
497
} ,
443
498
copy_options : mt:: CopyOptions {
444
499
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -496,6 +551,7 @@ fn test_user_stage_s3_v11() -> anyhow::Result<()> {
496
551
escape : "" . to_string ( ) ,
497
552
compression : mt:: StageFileCompression :: Bz2 ,
498
553
row_tag : "" . to_string ( ) ,
554
+ quote : "" . to_string ( ) ,
499
555
} ,
500
556
copy_options : mt:: CopyOptions {
501
557
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -551,6 +607,7 @@ fn test_user_stage_s3_v9() -> anyhow::Result<()> {
551
607
escape : "" . to_string ( ) ,
552
608
compression : mt:: StageFileCompression :: Bz2 ,
553
609
row_tag : "" . to_string ( ) ,
610
+ quote : "" . to_string ( ) ,
554
611
} ,
555
612
copy_options : mt:: CopyOptions {
556
613
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -597,6 +654,7 @@ fn test_user_stage_fs_v6() -> anyhow::Result<()> {
597
654
escape : "" . to_string ( ) ,
598
655
compression : mt:: StageFileCompression :: Bz2 ,
599
656
row_tag : "" . to_string ( ) ,
657
+ quote : "" . to_string ( ) ,
600
658
} ,
601
659
copy_options : mt:: CopyOptions {
602
660
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -653,6 +711,7 @@ fn test_user_stage_s3_v6() -> anyhow::Result<()> {
653
711
escape : "" . to_string ( ) ,
654
712
compression : mt:: StageFileCompression :: Bz2 ,
655
713
row_tag : "" . to_string ( ) ,
714
+ quote : "" . to_string ( ) ,
656
715
} ,
657
716
copy_options : mt:: CopyOptions {
658
717
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -705,6 +764,7 @@ fn test_user_stage_gcs_v6() -> anyhow::Result<()> {
705
764
escape : "" . to_string ( ) ,
706
765
compression : mt:: StageFileCompression :: Bz2 ,
707
766
row_tag : "" . to_string ( ) ,
767
+ quote : "" . to_string ( ) ,
708
768
} ,
709
769
copy_options : mt:: CopyOptions {
710
770
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -750,6 +810,7 @@ fn test_user_stage_fs_v4() -> anyhow::Result<()> {
750
810
escape : "" . to_string ( ) ,
751
811
compression : mt:: StageFileCompression :: Bz2 ,
752
812
row_tag : "" . to_string ( ) ,
813
+ quote : "" . to_string ( ) ,
753
814
} ,
754
815
copy_options : mt:: CopyOptions {
755
816
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -806,6 +867,7 @@ fn test_user_stage_s3_v4() -> anyhow::Result<()> {
806
867
escape : "" . to_string ( ) ,
807
868
compression : mt:: StageFileCompression :: Bz2 ,
808
869
row_tag : "" . to_string ( ) ,
870
+ quote : "" . to_string ( ) ,
809
871
} ,
810
872
copy_options : mt:: CopyOptions {
811
873
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -857,6 +919,7 @@ fn test_user_stage_gcs_v4() -> anyhow::Result<()> {
857
919
escape : "" . to_string ( ) ,
858
920
compression : mt:: StageFileCompression :: Bz2 ,
859
921
row_tag : "" . to_string ( ) ,
922
+ quote : "" . to_string ( ) ,
860
923
} ,
861
924
copy_options : mt:: CopyOptions {
862
925
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -910,6 +973,7 @@ fn test_user_stage_s3_v1() -> anyhow::Result<()> {
910
973
escape : "" . to_string ( ) ,
911
974
compression : mt:: StageFileCompression :: Bz2 ,
912
975
row_tag : "" . to_string ( ) ,
976
+ quote : "" . to_string ( ) ,
913
977
} ,
914
978
copy_options : mt:: CopyOptions {
915
979
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -958,6 +1022,7 @@ fn test_internal_stage_v17() -> anyhow::Result<()> {
958
1022
escape : "" . to_string ( ) ,
959
1023
compression : mt:: StageFileCompression :: Bz2 ,
960
1024
row_tag : "" . to_string ( ) ,
1025
+ quote : "" . to_string ( ) ,
961
1026
} ,
962
1027
copy_options : mt:: CopyOptions {
963
1028
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
@@ -1005,6 +1070,7 @@ fn test_user_stage_v18() -> anyhow::Result<()> {
1005
1070
escape : "" . to_string ( ) ,
1006
1071
compression : mt:: StageFileCompression :: Bz2 ,
1007
1072
row_tag : "" . to_string ( ) ,
1073
+ quote : "" . to_string ( ) ,
1008
1074
} ,
1009
1075
copy_options : mt:: CopyOptions {
1010
1076
on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
0 commit comments