Skip to content

Commit f73c824

Browse files
committed
[SPARK-51787] Remove sessionID parameter from getExecutePlanRequest
### What changes were proposed in this pull request? This PR removes unused parameter `sessionID` from `getExecutePlanRequest`. ### Why are the changes needed? We use the existing `self.sessionID` in this method. `sessionID` parameter is a leftover during refactoring. ### Does this PR introduce _any_ user-facing change? No. This is an internal API change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #55 from dongjoon-hyun/SPARK-51787. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent d5856c6 commit f73c824

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Sources/SparkConnect/DataFrame.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public actor DataFrame: Sendable {
139139
)
140140
) { client in
141141
let service = Spark_Connect_SparkConnectService.Client(wrapping: client)
142-
try await service.executePlan(spark.client.getExecutePlanRequest(spark.sessionID, plan)) {
142+
try await service.executePlan(spark.client.getExecutePlanRequest(plan)) {
143143
response in
144144
for try await m in response.messages {
145145
counter.add(m.arrowBatch.rowCount, ordering: .relaxed)
@@ -158,7 +158,7 @@ public actor DataFrame: Sendable {
158158
)
159159
) { client in
160160
let service = Spark_Connect_SparkConnectService.Client(wrapping: client)
161-
try await service.executePlan(spark.client.getExecutePlanRequest(spark.sessionID, plan)) {
161+
try await service.executePlan(spark.client.getExecutePlanRequest(plan)) {
162162
response in
163163
for try await m in response.messages {
164164
if m.hasSchema {

Sources/SparkConnect/SparkConnectClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public actor SparkConnectClient {
222222
/// - Parameters:
223223
/// - plan: A plan to execute.
224224
/// - Returns: An ``ExecutePlanRequest`` instance.
225-
func getExecutePlanRequest(_ sessionID: String, _ plan: Plan) async
225+
func getExecutePlanRequest(_ plan: Plan) async
226226
-> ExecutePlanRequest
227227
{
228228
var request = ExecutePlanRequest()
@@ -402,7 +402,7 @@ public actor SparkConnectClient {
402402
let service = SparkConnectService.Client(wrapping: client)
403403
var plan = Plan()
404404
plan.opType = .command(command)
405-
try await service.executePlan(getExecutePlanRequest(sessionID, plan)) {
405+
try await service.executePlan(getExecutePlanRequest(plan)) {
406406
response in
407407
for try await m in response.messages {
408408
await self.addResponse(m)

Tests/SparkConnectTests/SparkConnectClientTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ struct SparkConnectClientTests {
5050
@Test
5151
func tags() async throws {
5252
let client = SparkConnectClient(remote: "sc://localhost", user: "test")
53-
let sessionID = UUID().uuidString
54-
let _ = try await client.connect(sessionID)
53+
let _ = try await client.connect(UUID().uuidString)
5554
let plan = await client.getPlanRange(0, 1, 1)
5655

57-
#expect(await client.getExecutePlanRequest(sessionID, plan).tags.isEmpty)
56+
#expect(await client.getExecutePlanRequest(plan).tags.isEmpty)
5857
try await client.addTag(tag: "tag1")
5958

60-
#expect(await client.getExecutePlanRequest(sessionID, plan).tags == ["tag1"])
59+
#expect(await client.getExecutePlanRequest(plan).tags == ["tag1"])
6160
await client.clearTags()
6261

63-
#expect(await client.getExecutePlanRequest(sessionID, plan).tags.isEmpty)
62+
#expect(await client.getExecutePlanRequest(plan).tags.isEmpty)
6463
await client.stop()
6564
}
6665
}

0 commit comments

Comments
 (0)