You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2025/11/21 22:42:23 UTC
Re: [PR] [SPARK-54452] Fix empty response from SparkConnect server for `spark.sql(...)` inside FlowFunction [spark]
dongjoon-hyun commented on code in PR #53156:
URL: https://github.com/apache/spark/pull/53156#discussion_r2551147692
##########
sql/connect/server/src/test/scala/org/apache/spark/sql/connect/pipelines/SparkDeclarativePipelinesServerSuite.scala:
##########
@@ -850,4 +850,98 @@ class SparkDeclarativePipelinesServerSuite
}
}
}
+
+ test(
+ "SPARK-54452: spark.sql() inside a pipeline flow function should return a sql_command_result") {
+ withRawBlockingStub { implicit stub =>
+ val graphId = createDataflowGraph
+ val pipelineAnalysisContext = proto.PipelineAnalysisContext
+ .newBuilder()
+ .setDataflowGraphId(graphId)
+ .setFlowName("flow1")
+ .build()
+ val userContext = proto.UserContext
+ .newBuilder()
+ .addExtensions(com.google.protobuf.Any.pack(pipelineAnalysisContext))
+ .setUserId("test_user")
+ .build()
+
+ val relation = proto.Plan
+ .newBuilder()
+ .setCommand(
+ proto.Command
+ .newBuilder()
+ .setSqlCommand(
+ proto.SqlCommand
Review Comment:
May I ask why we use different `setSqlCommand` in two test cases? Can we use the following like the other test case in the same way?
```scala
.setSqlCommand(
proto.SqlCommand
.newBuilder()
.setInput(proto.Relation
.newBuilder()
.setSql(proto.SQL.newBuilder().setQuery("SELECT * FROM RANGE(5)"))
.build())
.build())
.build())
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org