Skip to content

Commit 1efa319

Browse files
committed
[SPARK-54043] Update Spark Connect-generated Swift source code with 4.1.0-preview3 RC1
1 parent 8816b7c commit 1efa319

File tree

5 files changed

+1925
-223
lines changed

5 files changed

+1925
-223
lines changed

Sources/SparkConnect/base.grpc.swift

Lines changed: 271 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ internal enum Spark_Connect_SparkConnectService {
156156
method: "FetchErrorDetails"
157157
)
158158
}
159+
/// Namespace for "CloneSession" metadata.
160+
internal enum CloneSession {
161+
/// Request type for "CloneSession".
162+
internal typealias Input = Spark_Connect_CloneSessionRequest
163+
/// Response type for "CloneSession".
164+
internal typealias Output = Spark_Connect_CloneSessionResponse
165+
/// Descriptor for "CloneSession".
166+
internal static let descriptor = GRPCCore.MethodDescriptor(
167+
service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "spark.connect.SparkConnectService"),
168+
method: "CloneSession"
169+
)
170+
}
159171
/// Descriptors for all methods in the "spark.connect.SparkConnectService" service.
160172
internal static let descriptors: [GRPCCore.MethodDescriptor] = [
161173
ExecutePlan.descriptor,
@@ -167,7 +179,8 @@ internal enum Spark_Connect_SparkConnectService {
167179
ReattachExecute.descriptor,
168180
ReleaseExecute.descriptor,
169181
ReleaseSession.descriptor,
170-
FetchErrorDetails.descriptor
182+
FetchErrorDetails.descriptor,
183+
CloneSession.descriptor
171184
]
172185
}
173186
}
@@ -388,6 +401,31 @@ extension Spark_Connect_SparkConnectService {
388401
request: GRPCCore.StreamingServerRequest<Spark_Connect_FetchErrorDetailsRequest>,
389402
context: GRPCCore.ServerContext
390403
) async throws -> GRPCCore.StreamingServerResponse<Spark_Connect_FetchErrorDetailsResponse>
404+
405+
/// Handle the "CloneSession" method.
406+
///
407+
/// > Source IDL Documentation:
408+
/// >
409+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
410+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
411+
/// > functions, catalog state) copied over to a new independent session. The cloned session
412+
/// > is isolated from the source session - any subsequent changes to either session's
413+
/// > server-side state will not be reflected in the other.
414+
/// >
415+
/// > The request can optionally specify a custom session ID for the cloned session (must be
416+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
417+
///
418+
/// - Parameters:
419+
/// - request: A streaming request of `Spark_Connect_CloneSessionRequest` messages.
420+
/// - context: Context providing information about the RPC.
421+
/// - Throws: Any error which occurred during the processing of the request. Thrown errors
422+
/// of type `RPCError` are mapped to appropriate statuses. All other errors are converted
423+
/// to an internal error.
424+
/// - Returns: A streaming response of `Spark_Connect_CloneSessionResponse` messages.
425+
func cloneSession(
426+
request: GRPCCore.StreamingServerRequest<Spark_Connect_CloneSessionRequest>,
427+
context: GRPCCore.ServerContext
428+
) async throws -> GRPCCore.StreamingServerResponse<Spark_Connect_CloneSessionResponse>
391429
}
392430

393431
/// Service protocol for the "spark.connect.SparkConnectService" service.
@@ -593,6 +631,31 @@ extension Spark_Connect_SparkConnectService {
593631
request: GRPCCore.ServerRequest<Spark_Connect_FetchErrorDetailsRequest>,
594632
context: GRPCCore.ServerContext
595633
) async throws -> GRPCCore.ServerResponse<Spark_Connect_FetchErrorDetailsResponse>
634+
635+
/// Handle the "CloneSession" method.
636+
///
637+
/// > Source IDL Documentation:
638+
/// >
639+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
640+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
641+
/// > functions, catalog state) copied over to a new independent session. The cloned session
642+
/// > is isolated from the source session - any subsequent changes to either session's
643+
/// > server-side state will not be reflected in the other.
644+
/// >
645+
/// > The request can optionally specify a custom session ID for the cloned session (must be
646+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
647+
///
648+
/// - Parameters:
649+
/// - request: A request containing a single `Spark_Connect_CloneSessionRequest` message.
650+
/// - context: Context providing information about the RPC.
651+
/// - Throws: Any error which occurred during the processing of the request. Thrown errors
652+
/// of type `RPCError` are mapped to appropriate statuses. All other errors are converted
653+
/// to an internal error.
654+
/// - Returns: A response containing a single `Spark_Connect_CloneSessionResponse` message.
655+
func cloneSession(
656+
request: GRPCCore.ServerRequest<Spark_Connect_CloneSessionRequest>,
657+
context: GRPCCore.ServerContext
658+
) async throws -> GRPCCore.ServerResponse<Spark_Connect_CloneSessionResponse>
596659
}
597660

598661
/// Simple service protocol for the "spark.connect.SparkConnectService" service.
@@ -798,6 +861,31 @@ extension Spark_Connect_SparkConnectService {
798861
request: Spark_Connect_FetchErrorDetailsRequest,
799862
context: GRPCCore.ServerContext
800863
) async throws -> Spark_Connect_FetchErrorDetailsResponse
864+
865+
/// Handle the "CloneSession" method.
866+
///
867+
/// > Source IDL Documentation:
868+
/// >
869+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
870+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
871+
/// > functions, catalog state) copied over to a new independent session. The cloned session
872+
/// > is isolated from the source session - any subsequent changes to either session's
873+
/// > server-side state will not be reflected in the other.
874+
/// >
875+
/// > The request can optionally specify a custom session ID for the cloned session (must be
876+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
877+
///
878+
/// - Parameters:
879+
/// - request: A `Spark_Connect_CloneSessionRequest` message.
880+
/// - context: Context providing information about the RPC.
881+
/// - Throws: Any error which occurred during the processing of the request. Thrown errors
882+
/// of type `RPCError` are mapped to appropriate statuses. All other errors are converted
883+
/// to an internal error.
884+
/// - Returns: A `Spark_Connect_CloneSessionResponse` to respond with.
885+
func cloneSession(
886+
request: Spark_Connect_CloneSessionRequest,
887+
context: GRPCCore.ServerContext
888+
) async throws -> Spark_Connect_CloneSessionResponse
801889
}
802890
}
803891

@@ -915,6 +1003,17 @@ extension Spark_Connect_SparkConnectService.StreamingServiceProtocol {
9151003
)
9161004
}
9171005
)
1006+
router.registerHandler(
1007+
forMethod: Spark_Connect_SparkConnectService.Method.CloneSession.descriptor,
1008+
deserializer: GRPCProtobuf.ProtobufDeserializer<Spark_Connect_CloneSessionRequest>(),
1009+
serializer: GRPCProtobuf.ProtobufSerializer<Spark_Connect_CloneSessionResponse>(),
1010+
handler: { request, context in
1011+
try await self.cloneSession(
1012+
request: request,
1013+
context: context
1014+
)
1015+
}
1016+
)
9181017
}
9191018
}
9201019

@@ -1030,6 +1129,17 @@ extension Spark_Connect_SparkConnectService.ServiceProtocol {
10301129
)
10311130
return GRPCCore.StreamingServerResponse(single: response)
10321131
}
1132+
1133+
internal func cloneSession(
1134+
request: GRPCCore.StreamingServerRequest<Spark_Connect_CloneSessionRequest>,
1135+
context: GRPCCore.ServerContext
1136+
) async throws -> GRPCCore.StreamingServerResponse<Spark_Connect_CloneSessionResponse> {
1137+
let response = try await self.cloneSession(
1138+
request: GRPCCore.ServerRequest(stream: request),
1139+
context: context
1140+
)
1141+
return GRPCCore.StreamingServerResponse(single: response)
1142+
}
10331143
}
10341144

10351145
// Default implementation of methods from 'ServiceProtocol'.
@@ -1172,6 +1282,19 @@ extension Spark_Connect_SparkConnectService.SimpleServiceProtocol {
11721282
metadata: [:]
11731283
)
11741284
}
1285+
1286+
internal func cloneSession(
1287+
request: GRPCCore.ServerRequest<Spark_Connect_CloneSessionRequest>,
1288+
context: GRPCCore.ServerContext
1289+
) async throws -> GRPCCore.ServerResponse<Spark_Connect_CloneSessionResponse> {
1290+
return GRPCCore.ServerResponse<Spark_Connect_CloneSessionResponse>(
1291+
message: try await self.cloneSession(
1292+
request: request.message,
1293+
context: context
1294+
),
1295+
metadata: [:]
1296+
)
1297+
}
11751298
}
11761299

11771300
// MARK: spark.connect.SparkConnectService (client)
@@ -1428,6 +1551,36 @@ extension Spark_Connect_SparkConnectService {
14281551
options: GRPCCore.CallOptions,
14291552
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Spark_Connect_FetchErrorDetailsResponse>) async throws -> Result
14301553
) async throws -> Result where Result: Sendable
1554+
1555+
/// Call the "CloneSession" method.
1556+
///
1557+
/// > Source IDL Documentation:
1558+
/// >
1559+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
1560+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
1561+
/// > functions, catalog state) copied over to a new independent session. The cloned session
1562+
/// > is isolated from the source session - any subsequent changes to either session's
1563+
/// > server-side state will not be reflected in the other.
1564+
/// >
1565+
/// > The request can optionally specify a custom session ID for the cloned session (must be
1566+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
1567+
///
1568+
/// - Parameters:
1569+
/// - request: A request containing a single `Spark_Connect_CloneSessionRequest` message.
1570+
/// - serializer: A serializer for `Spark_Connect_CloneSessionRequest` messages.
1571+
/// - deserializer: A deserializer for `Spark_Connect_CloneSessionResponse` messages.
1572+
/// - options: Options to apply to this RPC.
1573+
/// - handleResponse: A closure which handles the response, the result of which is
1574+
/// returned to the caller. Returning from the closure will cancel the RPC if it
1575+
/// hasn't already finished.
1576+
/// - Returns: The result of `handleResponse`.
1577+
func cloneSession<Result>(
1578+
request: GRPCCore.ClientRequest<Spark_Connect_CloneSessionRequest>,
1579+
serializer: some GRPCCore.MessageSerializer<Spark_Connect_CloneSessionRequest>,
1580+
deserializer: some GRPCCore.MessageDeserializer<Spark_Connect_CloneSessionResponse>,
1581+
options: GRPCCore.CallOptions,
1582+
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Spark_Connect_CloneSessionResponse>) async throws -> Result
1583+
) async throws -> Result where Result: Sendable
14311584
}
14321585

14331586
/// Generated client for the "spark.connect.SparkConnectService" service.
@@ -1797,6 +1950,47 @@ extension Spark_Connect_SparkConnectService {
17971950
onResponse: handleResponse
17981951
)
17991952
}
1953+
1954+
/// Call the "CloneSession" method.
1955+
///
1956+
/// > Source IDL Documentation:
1957+
/// >
1958+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
1959+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
1960+
/// > functions, catalog state) copied over to a new independent session. The cloned session
1961+
/// > is isolated from the source session - any subsequent changes to either session's
1962+
/// > server-side state will not be reflected in the other.
1963+
/// >
1964+
/// > The request can optionally specify a custom session ID for the cloned session (must be
1965+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
1966+
///
1967+
/// - Parameters:
1968+
/// - request: A request containing a single `Spark_Connect_CloneSessionRequest` message.
1969+
/// - serializer: A serializer for `Spark_Connect_CloneSessionRequest` messages.
1970+
/// - deserializer: A deserializer for `Spark_Connect_CloneSessionResponse` messages.
1971+
/// - options: Options to apply to this RPC.
1972+
/// - handleResponse: A closure which handles the response, the result of which is
1973+
/// returned to the caller. Returning from the closure will cancel the RPC if it
1974+
/// hasn't already finished.
1975+
/// - Returns: The result of `handleResponse`.
1976+
internal func cloneSession<Result>(
1977+
request: GRPCCore.ClientRequest<Spark_Connect_CloneSessionRequest>,
1978+
serializer: some GRPCCore.MessageSerializer<Spark_Connect_CloneSessionRequest>,
1979+
deserializer: some GRPCCore.MessageDeserializer<Spark_Connect_CloneSessionResponse>,
1980+
options: GRPCCore.CallOptions = .defaults,
1981+
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Spark_Connect_CloneSessionResponse>) async throws -> Result = { response in
1982+
try response.message
1983+
}
1984+
) async throws -> Result where Result: Sendable {
1985+
try await self.client.unary(
1986+
request: request,
1987+
descriptor: Spark_Connect_SparkConnectService.Method.CloneSession.descriptor,
1988+
serializer: serializer,
1989+
deserializer: deserializer,
1990+
options: options,
1991+
onResponse: handleResponse
1992+
)
1993+
}
18001994
}
18011995
}
18021996

@@ -2100,6 +2294,42 @@ extension Spark_Connect_SparkConnectService.ClientProtocol {
21002294
onResponse: handleResponse
21012295
)
21022296
}
2297+
2298+
/// Call the "CloneSession" method.
2299+
///
2300+
/// > Source IDL Documentation:
2301+
/// >
2302+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
2303+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
2304+
/// > functions, catalog state) copied over to a new independent session. The cloned session
2305+
/// > is isolated from the source session - any subsequent changes to either session's
2306+
/// > server-side state will not be reflected in the other.
2307+
/// >
2308+
/// > The request can optionally specify a custom session ID for the cloned session (must be
2309+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
2310+
///
2311+
/// - Parameters:
2312+
/// - request: A request containing a single `Spark_Connect_CloneSessionRequest` message.
2313+
/// - options: Options to apply to this RPC.
2314+
/// - handleResponse: A closure which handles the response, the result of which is
2315+
/// returned to the caller. Returning from the closure will cancel the RPC if it
2316+
/// hasn't already finished.
2317+
/// - Returns: The result of `handleResponse`.
2318+
internal func cloneSession<Result>(
2319+
request: GRPCCore.ClientRequest<Spark_Connect_CloneSessionRequest>,
2320+
options: GRPCCore.CallOptions = .defaults,
2321+
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Spark_Connect_CloneSessionResponse>) async throws -> Result = { response in
2322+
try response.message
2323+
}
2324+
) async throws -> Result where Result: Sendable {
2325+
try await self.cloneSession(
2326+
request: request,
2327+
serializer: GRPCProtobuf.ProtobufSerializer<Spark_Connect_CloneSessionRequest>(),
2328+
deserializer: GRPCProtobuf.ProtobufDeserializer<Spark_Connect_CloneSessionResponse>(),
2329+
options: options,
2330+
onResponse: handleResponse
2331+
)
2332+
}
21032333
}
21042334

21052335
// Helpers providing sugared APIs for 'ClientProtocol' methods.
@@ -2443,4 +2673,44 @@ extension Spark_Connect_SparkConnectService.ClientProtocol {
24432673
onResponse: handleResponse
24442674
)
24452675
}
2676+
2677+
/// Call the "CloneSession" method.
2678+
///
2679+
/// > Source IDL Documentation:
2680+
/// >
2681+
/// > Create a clone of a Spark Connect session on the server side. The server-side session
2682+
/// > is cloned with all its current state (SQL configurations, temporary views, registered
2683+
/// > functions, catalog state) copied over to a new independent session. The cloned session
2684+
/// > is isolated from the source session - any subsequent changes to either session's
2685+
/// > server-side state will not be reflected in the other.
2686+
/// >
2687+
/// > The request can optionally specify a custom session ID for the cloned session (must be
2688+
/// > a valid UUID). If not provided, a new UUID will be generated automatically.
2689+
///
2690+
/// - Parameters:
2691+
/// - message: request message to send.
2692+
/// - metadata: Additional metadata to send, defaults to empty.
2693+
/// - options: Options to apply to this RPC, defaults to `.defaults`.
2694+
/// - handleResponse: A closure which handles the response, the result of which is
2695+
/// returned to the caller. Returning from the closure will cancel the RPC if it
2696+
/// hasn't already finished.
2697+
/// - Returns: The result of `handleResponse`.
2698+
internal func cloneSession<Result>(
2699+
_ message: Spark_Connect_CloneSessionRequest,
2700+
metadata: GRPCCore.Metadata = [:],
2701+
options: GRPCCore.CallOptions = .defaults,
2702+
onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse<Spark_Connect_CloneSessionResponse>) async throws -> Result = { response in
2703+
try response.message
2704+
}
2705+
) async throws -> Result where Result: Sendable {
2706+
let request = GRPCCore.ClientRequest<Spark_Connect_CloneSessionRequest>(
2707+
message: message,
2708+
metadata: metadata
2709+
)
2710+
return try await self.cloneSession(
2711+
request: request,
2712+
options: options,
2713+
onResponse: handleResponse
2714+
)
2715+
}
24462716
}

0 commit comments

Comments
 (0)