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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to