You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/BaseSessionStateBuilder.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,13 +70,12 @@ catalog: SessionCatalog
70
70
catalogManager:CatalogManager
71
71
```
72
72
73
-
[CatalogManager](connector/catalog/CatalogManager.md) that is created for the session-specific [SQLConf](#conf), [V2SessionCatalog](#v2SessionCatalog) and [SessionCatalog](#catalog).
73
+
[CatalogManager](connector/catalog/CatalogManager.md) that is created with this [V2SessionCatalog](#v2SessionCatalog) and this[SessionCatalog](#catalog).
74
74
75
75
`catalogManager` is used when:
76
76
77
-
*`BaseSessionStateBuilder` is requested for [Analyzer](#analyzer) and [Optimizer](#optimizer)
78
-
79
-
*`HiveSessionStateBuilder` is requested for [Analyzer](hive/HiveSessionStateBuilder.md#analyzer)
77
+
*`BaseSessionStateBuilder` is requested for the [Analyzer](#analyzer) and the [Optimizer](#optimizer)
78
+
*`HiveSessionStateBuilder` is requested for the [Analyzer](hive/HiveSessionStateBuilder.md#analyzer)
80
79
81
80
### SQLConf { #conf }
82
81
@@ -129,11 +128,13 @@ When requested for the first time (as a `lazy val`), `tableFunctionRegistry` req
129
128
v2SessionCatalog:V2SessionCatalog
130
129
```
131
130
132
-
[V2SessionCatalog](V2SessionCatalog.md) that is created for the session-specific [SessionCatalog](#catalog) and [SQLConf](#conf).
131
+
[V2SessionCatalog](V2SessionCatalog.md) that is created with this [SessionCatalog](#catalog).
132
+
133
+
This `V2SessionCatalog` is used when:
133
134
134
-
`v2SessionCatalog` is used when `BaseSessionStateBuilder` is requested for the [CatalogManager](#catalogManager).
135
+
*`BaseSessionStateBuilder` is requested for the [CatalogManager](#catalogManager)
`CatalogManager` is given a [CatalogPlugin](CatalogPlugin.md) when [created](#creating-instance) for the **default session catalog**.
21
+
`CatalogManager` is given a [CatalogPlugin](CatalogPlugin.md) when [created](#creating-instance) for the **default session catalog** (which is a [V2SessionCatalog](../../BaseSessionStateBuilder.md#v2SessionCatalog)).
22
22
23
23
`defaultSessionCatalog` is used as the [delegate catalog](CatalogExtension.md#setDelegateCatalog) when `CatalogManager` is requested to [load a V2SessionCatalog](#loadV2SessionCatalog).
24
24
25
-
`defaultSessionCatalog` is used as the fall-back catalog when `CatalogManager` is requested to [load a custom V2CatalogPlugin](#v2SessionCatalog).
25
+
`defaultSessionCatalog` is used as the fallback catalog when `CatalogManager` is requested to [load a custom V2CatalogPlugin](#v2SessionCatalog).
26
26
27
-
## <spanid="SESSION_CATALOG_NAME"> Default Catalog Name
27
+
## spark_catalog Default Catalog Name { #SESSION_CATALOG_NAME }
28
28
29
29
`CatalogManager` defines `spark_catalog` as the name of the default catalog ([V2SessionCatalog](../../V2SessionCatalog.md)).
30
30
31
31
`spark_catalog` is used as the default value of [spark.sql.defaultCatalog](../../configuration-properties.md#spark.sql.defaultCatalog) configuration property.
32
32
33
-
## <spanid="_currentCatalogName"> Current Catalog Name
`_currentCatalogName` can be changed using [setCurrentCatalog](#setCurrentCatalog).
42
42
43
-
## <spanid="currentCatalog"> Current CatalogPlugin
43
+
## Current CatalogPlugin { #currentCatalog }
44
44
45
45
```scala
46
46
currentCatalog:CatalogPlugin
@@ -56,22 +56,24 @@ currentCatalog: CatalogPlugin
56
56
57
57
*`ViewHelper` utility is requested to `generateViewProperties`
58
58
59
-
## <spanid="currentNamespace"> Current Namespace
59
+
## Current Namespace { #currentNamespace }
60
60
61
61
```scala
62
62
currentNamespace:Array[String]
63
63
```
64
64
65
65
`currentNamespace`...FIXME
66
66
67
+
---
68
+
67
69
`currentNamespace` is used when:
68
70
69
71
*`ResolveNamespace` analysis rule is executed
70
72
*`GetCurrentDatabase` analysis rule is executed
71
73
*`CatalogAndIdentifier` extractor utility is requested to `unapply`
72
74
*`ViewHelper` utility is requested to `generateViewProperties`
73
75
74
-
## <spanid="setCurrentNamespace"> Setting Current Namespace
76
+
## Setting Current Namespace { #setCurrentNamespace }
75
77
76
78
```scala
77
79
setCurrentNamespace(
@@ -80,9 +82,13 @@ setCurrentNamespace(
80
82
81
83
`setCurrentNamespace`...FIXME
82
84
83
-
`setCurrentNamespace` is used when `SetCatalogAndNamespaceExec` physical command is executed.
85
+
---
86
+
87
+
`setCurrentNamespace` is used when:
84
88
85
-
## <spanid="setCurrentCatalog"> Changing Current Catalog Name
89
+
*`SetCatalogAndNamespaceExec` physical command is executed
90
+
91
+
## Changing Current Catalog Name { #setCurrentCatalog }
86
92
87
93
```scala
88
94
setCurrentCatalog(
@@ -100,7 +106,7 @@ Only if the names are different, `setCurrentCatalog` makes it [_currentCatalogNa
100
106
*`SetCatalogCommand` logical command is executed
101
107
*[SetCatalogAndNamespaceExec](../../physical-operators/SetCatalogAndNamespaceExec.md) physical command is executed
102
108
103
-
## <spanid="catalog"> Finding CatalogPlugin by Name
109
+
## Finding CatalogPlugin by Name { #catalog }
104
110
105
111
```scala
106
112
catalog(
@@ -111,15 +117,15 @@ catalog(
111
117
112
118
Otherwise, `catalog` looks up the name in [catalogs](#catalogs) internal registry. When not found, `catalog` tries to [load a CatalogPlugin by name](Catalogs.md#load) (and registers it in [catalogs](#catalogs) internal registry).
113
119
120
+
---
121
+
114
122
`catalog` is used when:
115
123
116
124
*`CatalogManager` is requested to [isCatalogRegistered](#isCatalogRegistered) and [currentCatalog](#currentCatalog)
117
-
118
125
*`CatalogV2Util` utility is requested to [getTableProviderCatalog](CatalogV2Util.md#getTableProviderCatalog)
119
-
120
126
*`CatalogAndMultipartIdentifier`, `CatalogAndNamespace` and `CatalogAndIdentifier` utilities are requested to extract a [CatalogPlugin](CatalogPlugin.md) (`unapply`)
`loadV2SessionCatalog`[loads](Catalogs.md#load) the default [spark_catalog](#SESSION_CATALOG_NAME).
161
+
`loadV2SessionCatalog`[loads](Catalogs.md#load) the default [CatalogPlugin](CatalogPlugin.md) that handles [spark_catalog](#SESSION_CATALOG_NAME) catalog.
162
+
163
+
!!! note "spark.sql.catalog.spark_catalog"
164
+
[spark.sql.catalog.spark_catalog](../../configuration-properties.md#spark.sql.catalog.spark_catalog) configuration property is used to specify the fully-qualified class name of the session [CatalogPlugin](CatalogPlugin.md).
156
165
157
-
If it is of type [CatalogExtension](CatalogExtension.md), `loadV2SessionCatalog` requests it to [setDelegateCatalog](CatalogExtension.md#setDelegateCatalog) with the [defaultSessionCatalog](#defaultSessionCatalog).
166
+
Only if the `CatalogPlugin` is a [CatalogExtension](CatalogExtension.md), `loadV2SessionCatalog` assigns this [default session CatalogPlugin](#defaultSessionCatalog) to be the [delegate CatalogPlugin](CatalogExtension.md#setDelegateCatalog).
167
+
168
+
---
158
169
159
170
`loadV2SessionCatalog` is used when:
160
171
161
-
*`CatalogManager` is requested for a [CatalogPlugin](#v2SessionCatalog)
172
+
*`CatalogManager` is requested for the [user-specified v2 session catalog](#v2SessionCatalog)
`DelegatingCatalogExtension` is an [extension](#contract) of the [CatalogExtension](CatalogExtension.md) abstraction for catalogs that delegate unsupported catalog functions to the built-in session catalog.
3
+
`DelegatingCatalogExtension` is an [extension](#contract) of the [CatalogExtension](CatalogExtension.md) abstraction for catalogs that delegate unsupported catalog extensions to the [Delegate Catalog](#delegate).
4
+
5
+
`DelegatingCatalogExtension` is a convenience abstraction so that Spark extensions developers can focus on a subset of the [CatalogExtension](CatalogExtension.md) features.
6
+
7
+
## Delegate Catalog { #delegate }
8
+
9
+
`DelegatingCatalogExtension` can be given a [CatalogPlugin](CatalogPlugin.md) to handle the following (unless overriden):
0 commit comments