Commit ed02db5
[SPARK-52272][SQL] V2SessionCatalog does not alter schema on Hive Catalog
### What changes were proposed in this pull request?
V2SessionCatalog delegates alterTable to SessionCatalog (V1) alterTable. In the case of "hive", this should be changed to delegate to either alterTable or alterTableDataSchema.
### Why are the changes needed?
SessionCatalog has two API's, alterTable and alterTableDataSchema.
alterTable will silently ignore schema changes in Hive implementation (the API Javadoc: ` If the underlying implementation does not support altering a certain field, this becomes a no-op.` ).
So for Hive case, V2SessionCatalog needs to delegate schema changes to V1 alterTableDataSchema
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Add new test in HiveDDLSuite, verify functionality and which method is called.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes apache#51007 from szehon-ho/hive_alter_table_comment_new.
Authored-by: Szehon Ho <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent d18ee39 commit ed02db5
File tree
3 files changed
+50
-56
lines changed- sql
- core/src
- main/scala/org/apache/spark/sql/execution/datasources/v2
- test/scala/org/apache/spark/sql/execution/datasources/v2
- hive/src/test/scala/org/apache/spark/sql/hive/execution
3 files changed
+50
-56
lines changedLines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
309 | 314 | | |
310 | 315 | | |
311 | 316 | | |
| |||
Lines changed: 0 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | 593 | | |
610 | 594 | | |
611 | 595 | | |
| |||
627 | 611 | | |
628 | 612 | | |
629 | 613 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | 614 | | |
651 | 615 | | |
652 | 616 | | |
| |||
686 | 650 | | |
687 | 651 | | |
688 | 652 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | 653 | | |
705 | 654 | | |
706 | 655 | | |
| |||
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | | - | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
| |||
3392 | 3397 | | |
3393 | 3398 | | |
3394 | 3399 | | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
3395 | 3435 | | |
0 commit comments