Skip to content

Commit 6612588

Browse files
HyukjinKwonkai-chi
authored andcommitted
[SPARK-26496][SS][TEST] Avoid to use Random.nextString in StreamingInnerJoinSuite
## What changes were proposed in this pull request? Similar with apache#21446. Looks random string is not quite safe as a directory name. ```scala scala> val prefix = Random.nextString(10); val dir = new File("/tmp", "del_" + prefix + "-" + UUID.randomUUID.toString); dir.mkdirs() prefix: String = 窽텘⒘駖ⵚ駢⡞Ρ닋੎ dir: java.io.File = /tmp/del_窽텘⒘駖ⵚ駢⡞Ρ닋੎-a3f99855-c429-47a0-a108-47bca6905745 res40: Boolean = false // nope, didn't like this one ``` ## How was this patch tested? Unit test was added, and manually. Closes apache#23405 from HyukjinKwon/SPARK-26496. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]> (cherry picked from commit e63243d) Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 9632058 commit 6612588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with
350350
withTempDir { tempDir =>
351351
val queryId = UUID.randomUUID
352352
val opId = 0
353-
val path = Utils.createDirectory(tempDir.getAbsolutePath, Random.nextString(10)).toString
353+
val path = Utils.createDirectory(tempDir.getAbsolutePath, Random.nextFloat.toString).toString
354354
val stateInfo = StatefulOperatorStateInfo(path, queryId, opId, 0L, 5)
355355

356356
implicit val sqlContext = spark.sqlContext

0 commit comments

Comments
 (0)