dongjoon-hyun commented on a change in pull request #31296:
URL: https://github.com/apache/spark/pull/31296#discussion_r562949231
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
##########
@@ -2007,6 +2007,28 @@ class DatasetSuite extends QueryTest
checkAnswer(withUDF, Row(Row(1), null, null) :: Row(Row(1), null, null) ::
Nil)
}
+
+ test("SPARK-34205: Pipe Dataset") {
+ assume(TestUtils.testCommandAvailable("cat"))
+
+ val nums = spark.range(4)
+ val piped = nums.pipe("cat").toDF
+
+ checkAnswer(piped, Row("0") :: Row("1") :: Row("2") :: Row("3") :: Nil)
+
+ val piped2 = nums.pipe("wc -l").toDF.collect()
+ assert(piped2.size == 2)
+ assert(piped2(0).getString(0).trim == "2")
+ assert(piped2(1).getString(0).trim == "2")
+ }
+
+ test("SPARK-34205: pipe Dataset with empty partition") {
Review comment:
Thank you for making this sure!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]