Commit 4ee7f4d
authored
[Spark] Protocol version downgrade in the presence of table features (#2841)
## Description
This PR adds support for protocol versions downgrade when table features
exist in the protocol. The downgraded protocol versions should be the
minimum required to support all available table features. For example,
`Protocol(3, 7, DeletionVectors, RowTracking)` can be downgraded to
`Protocol(1, 7, RowTracking)` after removing the DV feature.
## How was this patch tested?
Added new UTs in DeltaProtocolVersionSuite. Furthermore, existing UTs
cover a significant part of the functionality. These these are the
following:
- Downgrade protocol version on table created with (3, 7).
- Downgrade protocol version on table created with (1, 7).
- Protocol version downgrade on a table with table features and added
legacy feature.
- Protocol version is not downgraded when writer features exist.
- Protocol version is not downgraded when reader+writer features exist.
- Protocol version is not downgraded when multiple reader+writer
features exist.
## Does this PR introduce _any_ user-facing changes?
Yes. Dropping a table feature from a table with multiple features may
now result to a Protocol versions downgrade. For example, `Protocol(3,
7, DeletionVectors, RowTracking)` can now be downgraded to `Protocol(1,
7, RowTracking)`.1 parent f6ebe24 commit 4ee7f4d
File tree
3 files changed
+88
-75
lines changed- spark/src
- main/scala/org/apache/spark/sql/delta/actions
- test/scala/org/apache/spark/sql/delta
3 files changed
+88
-75
lines changedLines changed: 30 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| |||
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
282 | 263 | | |
283 | 264 | | |
284 | 265 | | |
| |||
368 | 349 | | |
369 | 350 | | |
370 | 351 | | |
371 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
372 | 365 | | |
373 | 366 | | |
374 | 367 | | |
375 | 368 | | |
376 | 369 | | |
377 | | - | |
| 370 | + | |
378 | 371 | | |
379 | 372 | | |
380 | 373 | | |
| |||
Lines changed: 54 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3276 | 3276 | | |
3277 | 3277 | | |
3278 | 3278 | | |
3279 | | - | |
| 3279 | + | |
| 3280 | + | |
3280 | 3281 | | |
3281 | 3282 | | |
3282 | 3283 | | |
| |||
3297 | 3298 | | |
3298 | 3299 | | |
3299 | 3300 | | |
3300 | | - | |
3301 | | - | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
3302 | 3305 | | |
3303 | 3306 | | |
3304 | 3307 | | |
| |||
3345 | 3348 | | |
3346 | 3349 | | |
3347 | 3350 | | |
3348 | | - | |
| 3351 | + | |
3349 | 3352 | | |
3350 | 3353 | | |
3351 | 3354 | | |
| |||
3356 | 3359 | | |
3357 | 3360 | | |
3358 | 3361 | | |
3359 | | - | |
| 3362 | + | |
3360 | 3363 | | |
3361 | 3364 | | |
3362 | 3365 | | |
| |||
3418 | 3421 | | |
3419 | 3422 | | |
3420 | 3423 | | |
3421 | | - | |
| 3424 | + | |
3422 | 3425 | | |
3423 | 3426 | | |
3424 | 3427 | | |
| |||
3427 | 3430 | | |
3428 | 3431 | | |
3429 | 3432 | | |
3430 | | - | |
3431 | | - | |
3432 | | - | |
3433 | | - | |
3434 | | - | |
3435 | | - | |
3436 | | - | |
3437 | | - | |
3438 | | - | |
| 3433 | + | |
3439 | 3434 | | |
3440 | 3435 | | |
3441 | 3436 | | |
| |||
3473 | 3468 | | |
3474 | 3469 | | |
3475 | 3470 | | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
3476 | 3515 | | |
3477 | 3516 | | |
3478 | 3517 | | |
| |||
Lines changed: 4 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 279 | | |
284 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
| |||
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | 294 | | |
306 | 295 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 296 | | |
313 | 297 | | |
314 | 298 | | |
315 | 299 | | |
316 | 300 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | 301 | | |
321 | 302 | | |
322 | 303 | | |
| |||
0 commit comments