Skip to content
Closed
Changes from all commits
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
14 changes: 5 additions & 9 deletions core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1298,19 +1298,15 @@ class SizeBasedCoalescer(val maxSize: Int) extends PartitionCoalescer with Seria
val splitSize = fileSplit.getLength
if (currentSum + splitSize < maxSize) {
addPartition(partition, splitSize)
index += 1
if (index == partitions.size) {
updateGroups
}
} else {
if (currentGroup.partitions.size == 0) {
addPartition(partition, splitSize)
index += 1
} else {
updateGroups
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point out which line/lines cause the bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point out which line/lines cause the bug?

In the pr description I have show the case this bug happen. Not one line or some lines cause this error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you point out which line/lines cause the bug?

Change the desc make it more clear.

if (currentGroup.partitions.nonEmpty) {
updateGroups()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the following,

if (currentGroup.partitions.isEmpty) {
  addPartition(partition, splitSize)
} else {
  updateGroups()
  addPartition(partition, splitSize)
}

The following will be better.

if (currentGroup.partitions.nonEmpty) {
  updateGroups()
}
addPartition(partition, splitSize)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks

addPartition(partition, splitSize)
}
index += 1
}
updateGroups()
groups.toArray
}
}
Expand Down