Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-19613][SS][TEST] Random.nextString is not safe for directory namePrefix #21446

Closed
wants to merge 2 commits into from
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn

test("versioning and immutability") {
withSparkSession(SparkSession.builder.config(sparkConf).getOrCreate()) { spark =>
val path = Utils.createDirectory(tempDir, Random.nextString(10)).toString
val path = Utils.createDirectory(tempDir, Random.nextFloat.toString).toString
val rdd1 = makeRDD(spark.sparkContext, Seq("a", "b", "a")).mapPartitionsWithStateStore(
spark.sqlContext, operatorStateInfo(path, version = 0), keySchema, valueSchema, None)(
increment)
Expand All @@ -73,7 +73,7 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn
}

test("recovering from files") {
val path = Utils.createDirectory(tempDir, Random.nextString(10)).toString
val path = Utils.createDirectory(tempDir, Random.nextFloat.toString).toString

def makeStoreRDD(
spark: SparkSession,
Expand Down Expand Up @@ -101,7 +101,7 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn
test("usage with iterators - only gets and only puts") {
withSparkSession(SparkSession.builder.config(sparkConf).getOrCreate()) { spark =>
implicit val sqlContext = spark.sqlContext
val path = Utils.createDirectory(tempDir, Random.nextString(10)).toString
val path = Utils.createDirectory(tempDir, Random.nextFloat.toString).toString
val opId = 0

// Returns an iterator of the incremented value made into the store
Expand Down Expand Up @@ -149,7 +149,7 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn
quietly {
val queryRunId = UUID.randomUUID
val opId = 0
val path = Utils.createDirectory(tempDir, Random.nextString(10)).toString
val path = Utils.createDirectory(tempDir, Random.nextFloat.toString).toString

withSparkSession(SparkSession.builder.config(sparkConf).getOrCreate()) { spark =>
implicit val sqlContext = spark.sqlContext
Expand Down Expand Up @@ -189,7 +189,7 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn
.config(sparkConf.setMaster("local-cluster[2, 1, 1024]"))
.getOrCreate()) { spark =>
implicit val sqlContext = spark.sqlContext
val path = Utils.createDirectory(tempDir, Random.nextString(10)).toString
val path = Utils.createDirectory(tempDir, Random.nextFloat.toString).toString
val opId = 0
val rdd1 = makeRDD(spark.sparkContext, Seq("a", "b", "a")).mapPartitionsWithStateStore(
sqlContext, operatorStateInfo(path, version = 0), keySchema, valueSchema, None)(increment)
Expand Down