Skip to content

Commit b184363

Browse files
committed
[SPARK-26564] Fix wrong assertions and error messages for parameter checking
Fix newly found inconsistencies between assertions and messages
1 parent 73fd0a5 commit b184363

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private[ml] class WeightedLeastSquares(
8888
require(regParam >= 0.0, s"regParam cannot be negative: $regParam")
8989
require(elasticNetParam >= 0.0 && elasticNetParam <= 1.0,
9090
s"elasticNetParam must be in [0, 1]: $elasticNetParam")
91-
require(maxIter >= 0, s"maxIter must be a positive integer: $maxIter")
91+
require(maxIter > 0, s"maxIter must be a positive integer: $maxIter")
9292
require(tol >= 0.0, s"tol must be >= 0, but was set to $tol")
9393

9494
/**

sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private[execution] final class LongToUnsafeRowMap(val mm: TaskMemoryManager, cap
413413

414414
private def init(): Unit = {
415415
if (mm != null) {
416-
require(capacity < 512000000, "Cannot broadcast more than 512 millions rows")
416+
require(capacity <= 512000000, "Cannot broadcast more than 512 millions rows")
417417
var n = 1
418418
while (n < capacity) n *= 2
419419
ensureAcquireMemory(n * 2L * 8 + (1 << 20))

0 commit comments

Comments
 (0)