Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesjean committed Nov 21, 2023
1 parent 7e26217 commit 459bd08
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,7 @@ class SparkConnectPlanner(
// To avoid explicit handling of the result on the client, we build the expected input
// of the relation on the server. The client has to simply forward the result.
val result = SqlCommandResult.newBuilder()
// Only filled when isCommand
val metrics = ExecutePlanResponse.Metrics.newBuilder()
if (isCommand) {
// Convert the results to Arrow.
Expand Down Expand Up @@ -2612,7 +2613,8 @@ class SparkConnectPlanner(
.setSqlCommandResult(result)
.build())

// Send Metrics
// Send Metrics when isCommand (i.e. show tables) which is eagerly executed & has metrics
// Skip metrics when !isCommand (i.e. select 1) which is not executed & doesn't have metrics
if (isCommand) {
responseObserver.onNext(
ExecutePlanResponse
Expand Down

0 comments on commit 459bd08

Please sign in to comment.