Skip to content

Commit 7afac23

Browse files
committed
5282: fix int overflow in the warning
1 parent f38ef65 commit 7afac23

File tree

1 file changed

+1
-1
lines changed
  • mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed

1 file changed

+1
-1
lines changed

mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class RowMatrix(
131131
throw new IllegalArgumentException(s"Argument with more than 65535 cols: $cols")
132132
}
133133
if (cols > 10000) {
134-
val mem = cols * cols * 8
134+
val mem = (math.pow(cols, 2) * 8).formatted("%,.0f")
135135
logWarning(s"$cols columns will require at least $mem bytes of memory!")
136136
}
137137
}

0 commit comments

Comments
 (0)