@@ -14,6 +14,7 @@ const DEFAULT_MAX_CONCURRENT_STREAMS: usize = 8;
14
14
15
15
#[ derive( Debug , Clone , Serialize , Deserialize , ToSchema ) ]
16
16
#[ serde( rename_all = "snake_case" ) ]
17
+ #[ non_exhaustive]
17
18
pub enum FullApiDestinationConfig {
18
19
Memory ,
19
20
BigQuery {
@@ -30,6 +31,16 @@ pub enum FullApiDestinationConfig {
30
31
#[ serde( skip_serializing_if = "Option::is_none" ) ]
31
32
max_concurrent_streams : Option < usize > ,
32
33
} ,
34
+ DeltaLake {
35
+ #[ schema( example = "s3://my-bucket/my-path" ) ]
36
+ base_uri : String ,
37
+ #[ schema( example = "s3://my-bucket/my-path" ) ]
38
+ warehouse : Option < String > ,
39
+ #[ schema( example = "[\" date\" ]" ) ]
40
+ partition_columns : Option < Vec < String > > ,
41
+ #[ schema( example = 100 ) ]
42
+ optimize_after_commits : Option < u64 > ,
43
+ } ,
33
44
}
34
45
35
46
impl From < StoredDestinationConfig > for FullApiDestinationConfig {
@@ -49,6 +60,17 @@ impl From<StoredDestinationConfig> for FullApiDestinationConfig {
49
60
max_staleness_mins,
50
61
max_concurrent_streams : Some ( max_concurrent_streams) ,
51
62
} ,
63
+ StoredDestinationConfig :: DeltaLake {
64
+ base_uri,
65
+ warehouse,
66
+ partition_columns,
67
+ optimize_after_commits,
68
+ } => Self :: DeltaLake {
69
+ base_uri,
70
+ warehouse,
71
+ partition_columns,
72
+ optimize_after_commits,
73
+ } ,
52
74
}
53
75
}
54
76
}
@@ -64,6 +86,12 @@ pub enum StoredDestinationConfig {
64
86
max_staleness_mins : Option < u16 > ,
65
87
max_concurrent_streams : usize ,
66
88
} ,
89
+ DeltaLake {
90
+ base_uri : String ,
91
+ warehouse : Option < String > ,
92
+ partition_columns : Option < Vec < String > > ,
93
+ optimize_after_commits : Option < u64 > ,
94
+ } ,
67
95
}
68
96
69
97
impl StoredDestinationConfig {
@@ -83,6 +111,17 @@ impl StoredDestinationConfig {
83
111
max_staleness_mins,
84
112
max_concurrent_streams,
85
113
} ,
114
+ Self :: DeltaLake {
115
+ base_uri,
116
+ warehouse,
117
+ partition_columns,
118
+ optimize_after_commits,
119
+ } => DestinationConfig :: DeltaLake {
120
+ base_uri,
121
+ warehouse,
122
+ partition_columns,
123
+ optimize_after_commits,
124
+ } ,
86
125
}
87
126
}
88
127
}
@@ -105,6 +144,17 @@ impl From<FullApiDestinationConfig> for StoredDestinationConfig {
105
144
max_concurrent_streams : max_concurrent_streams
106
145
. unwrap_or ( DEFAULT_MAX_CONCURRENT_STREAMS ) ,
107
146
} ,
147
+ FullApiDestinationConfig :: DeltaLake {
148
+ base_uri,
149
+ warehouse,
150
+ partition_columns,
151
+ optimize_after_commits,
152
+ } => Self :: DeltaLake {
153
+ base_uri,
154
+ warehouse,
155
+ partition_columns,
156
+ optimize_after_commits,
157
+ } ,
108
158
}
109
159
}
110
160
}
@@ -136,12 +186,26 @@ impl Encrypt<EncryptedStoredDestinationConfig> for StoredDestinationConfig {
136
186
max_concurrent_streams,
137
187
} )
138
188
}
189
+ Self :: DeltaLake {
190
+ base_uri,
191
+ warehouse,
192
+ partition_columns,
193
+ optimize_after_commits,
194
+ } => {
195
+ Ok ( EncryptedStoredDestinationConfig :: DeltaLake {
196
+ base_uri,
197
+ warehouse,
198
+ partition_columns,
199
+ optimize_after_commits,
200
+ } )
201
+ }
139
202
}
140
203
}
141
204
}
142
205
143
206
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
144
207
#[ serde( rename_all = "snake_case" ) ]
208
+ #[ non_exhaustive]
145
209
pub enum EncryptedStoredDestinationConfig {
146
210
Memory ,
147
211
BigQuery {
@@ -151,7 +215,13 @@ pub enum EncryptedStoredDestinationConfig {
151
215
max_staleness_mins : Option < u16 > ,
152
216
max_concurrent_streams : usize ,
153
217
} ,
154
- }
218
+ DeltaLake {
219
+ base_uri : String ,
220
+ warehouse : Option < String > ,
221
+ partition_columns : Option < Vec < String > > ,
222
+ optimize_after_commits : Option < u64 > ,
223
+ } ,
224
+ }
155
225
156
226
impl Store for EncryptedStoredDestinationConfig { }
157
227
@@ -182,6 +252,17 @@ impl Decrypt<StoredDestinationConfig> for EncryptedStoredDestinationConfig {
182
252
max_concurrent_streams,
183
253
} )
184
254
}
255
+ Self :: DeltaLake {
256
+ base_uri,
257
+ warehouse,
258
+ partition_columns,
259
+ optimize_after_commits,
260
+ } => Ok ( StoredDestinationConfig :: DeltaLake {
261
+ base_uri,
262
+ warehouse,
263
+ partition_columns,
264
+ optimize_after_commits,
265
+ } ) ,
185
266
}
186
267
}
187
268
}
0 commit comments