Commit cbb4e7d
[SPARK-39646][SQL] Make setCurrentDatabase compatible with 3 layer namespace
### What changes were proposed in this pull request?
Change `setCurrentDatabase` catalog API to support 3 layer namespace. We use `sparkSession.sessionState.catalogManager.currentNamespace` for the currentDatabase now.
### Why are the changes needed?
`setCurrentDatabase` doesn't support 3 layer namespace.
### Does this PR introduce _any_ user-facing change?
Yes. This PR introduces a backwards-compatible API change to support 3 layer namespace (e.g. catalog.database.table) for `setCurrentDatabase`.
### How was this patch tested?
UT
Closes #36969 from schuermannator/3l-setCurrentDatabse.
Authored-by: Zach Schuermann <zachary.zvs@gmail.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>1 parent 6624d91 commit cbb4e7d
File tree
3 files changed
+37
-5
lines changed- R/pkg/tests/fulltests
- sql/core/src
- main/scala/org/apache/spark/sql/internal
- test/scala/org/apache/spark/sql/internal
3 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4015 | 4015 | | |
4016 | 4016 | | |
4017 | 4017 | | |
4018 | | - | |
4019 | | - | |
| 4018 | + | |
| 4019 | + | |
4020 | 4020 | | |
4021 | 4021 | | |
4022 | 4022 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
869 | 898 | | |
0 commit comments