@@ -43,6 +43,55 @@ fn test_user_stage_gcs_latest() -> anyhow::Result<()> {
4343 Ok ( ( ) )
4444}
4545
46+ #[ test]
47+ fn test_user_stage_s3_v8 ( ) -> anyhow:: Result < ( ) > {
48+ // Encoded data of version 8 of user_stage_s3:
49+ // It is generated with common::test_pb_from_to.
50+ let user_stage_s3_v8 = vec ! [
51+ 10 , 24 , 115 , 51 , 58 , 47 , 47 , 109 , 121 , 98 , 117 , 99 , 107 , 101 , 116 , 47 , 100 , 97 , 116 , 97 ,
52+ 47 , 102 , 105 , 108 , 101 , 115 , 16 , 1 , 26 , 100 , 10 , 98 , 10 , 96 , 18 , 24 , 104 , 116 , 116 , 112 ,
53+ 115 , 58 , 47 , 47 , 115 , 51 , 46 , 97 , 109 , 97 , 122 , 111 , 110 , 97 , 119 , 115 , 46 , 99 , 111 , 109 ,
54+ 26 , 9 , 109 , 121 , 95 , 107 , 101 , 121 , 95 , 105 , 100 , 34 , 13 , 109 , 121 , 95 , 115 , 101 , 99 , 114 ,
55+ 101 , 116 , 95 , 107 , 101 , 121 , 42 , 8 , 109 , 121 , 98 , 117 , 99 , 107 , 101 , 116 , 50 , 11 , 47 , 100 ,
56+ 97 , 116 , 97 , 47 , 102 , 105 , 108 , 101 , 115 , 58 , 13 , 109 , 121 , 95 , 109 , 97 , 115 , 116 , 101 ,
57+ 114 , 95 , 107 , 101 , 121 , 160 , 6 , 8 , 168 , 6 , 1 , 34 , 20 , 8 , 1 , 16 , 128 , 8 , 26 , 1 , 124 , 34 , 2 ,
58+ 47 , 47 , 40 , 2 , 160 , 6 , 8 , 168 , 6 , 1 , 42 , 10 , 10 , 3 , 32 , 154 , 5 , 16 , 142 , 8 , 24 , 1 , 50 , 4 ,
59+ 116 , 101 , 115 , 116 , 160 , 6 , 8 , 168 , 6 , 1 ,
60+ ] ;
61+
62+ let want = mt:: UserStageInfo {
63+ stage_name : "s3://mybucket/data/files" . to_string ( ) ,
64+ stage_type : mt:: StageType :: External ,
65+ stage_params : mt:: StageParams {
66+ storage : StorageParams :: S3 ( StorageS3Config {
67+ bucket : "mybucket" . to_string ( ) ,
68+ root : "/data/files" . to_string ( ) ,
69+ access_key_id : "my_key_id" . to_string ( ) ,
70+ secret_access_key : "my_secret_key" . to_string ( ) ,
71+ master_key : "my_master_key" . to_string ( ) ,
72+ ..Default :: default ( )
73+ } ) ,
74+ } ,
75+ file_format_options : mt:: FileFormatOptions {
76+ format : mt:: StageFileFormatType :: Json ,
77+ skip_header : 1024 ,
78+ field_delimiter : "|" . to_string ( ) ,
79+ record_delimiter : "//" . to_string ( ) ,
80+ compression : mt:: StageFileCompression :: Bz2 ,
81+ } ,
82+ copy_options : mt:: CopyOptions {
83+ on_error : mt:: OnErrorMode :: SkipFileNum ( 666 ) ,
84+ size_limit : 1038 ,
85+ purge : true ,
86+ } ,
87+ comment : "test" . to_string ( ) ,
88+ ..Default :: default ( )
89+ } ;
90+
91+ common:: test_load_old ( func_name ! ( ) , user_stage_s3_v8. as_slice ( ) , want) ?;
92+ Ok ( ( ) )
93+ }
94+
4695#[ test]
4796fn test_user_stage_fs_v6 ( ) -> anyhow:: Result < ( ) > {
4897 // Encoded data of version 6 of user_stage_fs:
0 commit comments