Skip to content

Commit 2e00a47

Browse files
committed
use count
1 parent 7acec6c commit 2e00a47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Tests/SparkConnectTests/DataFrameTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,25 +660,25 @@ struct DataFrameTests {
660660
func distinct() async throws {
661661
let spark = try await SparkSession.builder.getOrCreate()
662662
let df = try await spark.sql("SELECT * FROM VALUES (1), (2), (3), (1), (3) T(a)")
663-
#expect(try await df.distinct().collect() == [Row(1), Row(2), Row(3)])
663+
#expect(try await df.distinct().count() == 3)
664664
await spark.stop()
665665
}
666666

667667
@Test
668668
func dropDuplicates() async throws {
669669
let spark = try await SparkSession.builder.getOrCreate()
670670
let df = try await spark.sql("SELECT * FROM VALUES (1), (2), (3), (1), (3) T(a)")
671-
#expect(try await df.dropDuplicates().collect() == [Row(1), Row(2), Row(3)])
672-
#expect(try await df.dropDuplicates("a").collect() == [Row(1), Row(2), Row(3)])
671+
#expect(try await df.dropDuplicates().count() == 3)
672+
#expect(try await df.dropDuplicates("a").count() == 3)
673673
await spark.stop()
674674
}
675675

676676
@Test
677677
func dropDuplicatesWithinWatermark() async throws {
678678
let spark = try await SparkSession.builder.getOrCreate()
679679
let df = try await spark.sql("SELECT * FROM VALUES (1), (2), (3), (1), (3) T(a)")
680-
#expect(try await df.dropDuplicatesWithinWatermark().collect() == [Row(1), Row(2), Row(3)])
681-
#expect(try await df.dropDuplicatesWithinWatermark("a").collect() == [Row(1), Row(2), Row(3)])
680+
#expect(try await df.dropDuplicatesWithinWatermark().count() == 3)
681+
#expect(try await df.dropDuplicatesWithinWatermark("a").count() == 3)
682682
await spark.stop()
683683
}
684684

0 commit comments

Comments
 (0)