Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: add test for 873
  • Loading branch information
SemyonSinchenko committed Aug 24, 2026
commit 4d6f1440c5055564aae1ae730f54c6b2ce003e11
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ trait GraphFrameTestSparkContext extends BeforeAndAfterAll { self: Suite =>
.master("local[2]")
.appName("GraphFramesUnitTest")
.config("spark.sql.shuffle.partitions", 4)
.config("spark.sql.adaptive.enabled", "true")
.getOrCreate()

val checkpointDir = Files.createTempDirectory(this.getClass.getName).toString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ class ConnectedComponentsSuite extends SparkFunSuite with GraphFrameTestSparkCon
else ""}${if (useSkewedJoin) ", skewed join" else ", AQE join"}"
val broadcastThreshold = if (useSkewedJoin) 1000000 else -1

test(s"non trivial graph #873$testPostfixName") {
val edges = spark
.createDataFrame(
Seq((1L, 2L), (2L, 3L), (3L, 4L), (4L, 5L), (5L, 1L), (6L, 7L), (7L, 8L), (8L, 6L)))
.toDF("src", "dst")

val vertices =
edges.select("src").union(edges.select("dst")).distinct().withColumnRenamed("src", "id")
val g = GraphFrame(vertices, edges)

val result = g.connectedComponents
.setBroadcastThreshold(broadcastThreshold)
.setUseLocalCheckpoints(useLocalCheckpoint)
.run()
val numComps = result.select("component").distinct().count()
assert(numComps == 2L)
}

test(s"empty graph$testPostfixName") {
for (empty <- Seq(Graphs.empty[Int], Graphs.empty[Long], Graphs.empty[String])) {
val components = empty.connectedComponents
Expand Down
Loading