hvanhovell commented on code in PR #40048:
URL: https://github.com/apache/spark/pull/40048#discussion_r1107952394
##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala:
##########
@@ -32,40 +32,44 @@ class ClientE2ETestSuite extends RemoteSparkSession {
// Spark Result
test("spark result schema") {
val df = spark.sql("select val from (values ('Hello'), ('World')) as
t(val)")
- val schema = df.collectResult().schema
- assert(schema == StructType(StructField("val", StringType, false) :: Nil))
+ df.withResult { result =>
+ val schema = result.schema
+ assert(schema == StructType(StructField("val", StringType, nullable =
false) :: Nil))
+ }
}
test("spark result array") {
val df = spark.sql("select val from (values ('Hello'), ('World')) as
t(val)")
- val result = df.collectResult()
- assert(result.length == 2)
- val array = result.toArray
- assert(array.length == 2)
- assert(array(0).getString(0) == "Hello")
- assert(array(1).getString(0) == "World")
+ df.withResult { result =>
Review Comment:
we could also use df.collect() here.
--
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]