You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2019/02/27 14:38:28 UTC
[spark] branch master updated: [MINOR] Simplify boolean expression
This is an automated email from the ASF dual-hosted git repository.
srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 7912dbb [MINOR] Simplify boolean expression
7912dbb is described below
commit 7912dbb88fe0a2dcf2aad61c73d26ae7254ca644
Author: liuxian <li...@zte.com.cn>
AuthorDate: Wed Feb 27 08:38:00 2019 -0600
[MINOR] Simplify boolean expression
## What changes were proposed in this pull request?
Comparing whether Boolean expression is equal to true is redundant
For example:
The datatype of `a` is boolean.
Before:
if (a == true)
After:
if (a)
## How was this patch tested?
N/A
Closes #23884 from 10110346/simplifyboolean.
Authored-by: liuxian <li...@zte.com.cn>
Signed-off-by: Sean Owen <se...@databricks.com>
---
.../scala/org/apache/spark/rpc/netty/Outbox.scala | 2 +-
.../scala/org/apache/spark/CheckpointSuite.scala | 6 +-
.../scala/org/apache/spark/DistributedSuite.scala | 4 +-
.../test/scala/org/apache/spark/FileSuite.scala | 20 +--
.../scala/org/apache/spark/SSLOptionsSuite.scala | 22 ++--
.../org/apache/spark/SecurityManagerSuite.scala | 136 ++++++++++-----------
.../scala/org/apache/spark/SparkConfSuite.scala | 2 +-
.../org/apache/spark/SparkContextInfoSuite.scala | 4 +-
.../scala/org/apache/spark/UnpersistSuite.scala | 6 +-
.../org/apache/spark/rdd/RDDBarrierSuite.scala | 4 +-
.../test/scala/org/apache/spark/rdd/RDDSuite.scala | 6 +-
.../scala/org/apache/spark/rpc/RpcEnvSuite.scala | 4 +-
.../CoarseGrainedSchedulerBackendSuite.scala | 2 +-
.../apache/spark/scheduler/DAGSchedulerSuite.scala | 4 +-
.../apache/spark/scheduler/TaskContextSuite.scala | 2 +-
.../spark/scheduler/TaskSetManagerSuite.scala | 2 +-
.../spark/status/AppStatusListenerSuite.scala | 2 +-
.../apache/spark/storage/BlockManagerSuite.scala | 2 +-
.../spark/util/BoundedPriorityQueueSuite.scala | 4 +-
.../org/apache/spark/util/ThreadUtilsSuite.scala | 4 +-
.../spark/util/UninterruptibleThreadSuite.scala | 6 +-
.../scala/org/apache/spark/util/UtilsSuite.scala | 8 +-
.../spark/util/collection/AppendOnlyMapSuite.scala | 4 +-
.../streaming/kinesis/KinesisStreamSuite.scala | 2 +-
.../spark/ml/feature/OneHotEncoderSuite.scala | 4 +-
.../deploy/k8s/KubernetesVolumeUtilsSuite.scala | 8 +-
.../features/BasicExecutorFeatureStepSuite.scala | 2 +-
.../features/MountVolumesFeatureStepSuite.scala | 2 +-
.../yarn/YarnAllocatorBlacklistTrackerSuite.scala | 2 +-
.../sql/catalyst/plans/logical/LogicalPlan.scala | 2 +-
.../catalyst/analysis/DecimalPrecisionSuite.scala | 14 +--
.../catalyst/encoders/ExpressionEncoderSuite.scala | 8 +-
.../catalyst/expressions/AttributeSetSuite.scala | 10 +-
.../spark/sql/catalyst/expressions/CastSuite.scala | 70 +++++------
.../expressions/CollectionExpressionsSuite.scala | 18 +--
.../catalyst/expressions/ComplexTypeSuite.scala | 6 +-
.../expressions/ConditionalExpressionSuite.scala | 24 ++--
.../expressions/DateExpressionsSuite.scala | 6 +-
.../expressions/StringExpressionsSuite.scala | 7 +-
.../codegen/CodegenExpressionCachingSuite.scala | 6 +-
.../expressions/xml/UDFXPathUtilSuite.scala | 2 +-
.../sql/catalyst/plans/LogicalPlanSuite.scala | 6 +-
.../spark/sql/catalyst/util/MetadataSuite.scala | 24 ++--
.../types/DataTypeWriteCompatibilitySuite.scala | 2 +-
.../org/apache/spark/sql/types/MetadataSuite.scala | 2 +-
.../state/HDFSBackedStateStoreProvider.scala | 2 +-
.../apache/spark/sql/DatasetAggregatorSuite.scala | 4 +-
.../scala/org/apache/spark/sql/DatasetSuite.scala | 30 ++---
.../apache/spark/sql/execution/PlannerSuite.scala | 2 +-
.../streaming/ProcessingTimeExecutorSuite.scala | 2 +-
.../state/StateStoreCoordinatorSuite.scala | 14 +--
.../execution/vectorized/ColumnVectorSuite.scala | 14 +--
.../execution/vectorized/ColumnarBatchSuite.scala | 8 +-
.../spark/sql/internal/SQLConfEntrySuite.scala | 6 +-
.../apache/spark/sql/internal/SQLConfSuite.scala | 4 +-
.../streaming/FlatMapGroupsWithStateSuite.scala | 4 +-
.../streaming/StreamingQueryListenerSuite.scala | 8 +-
.../spark/sql/streaming/StreamingQuerySuite.scala | 20 +--
.../sources/StreamingDataSourceV2Suite.scala | 4 +-
.../spark/sql/hive/client/VersionsSuite.scala | 8 +-
.../apache/spark/streaming/CheckpointSuite.scala | 4 +-
.../org/apache/spark/streaming/StateMapSuite.scala | 2 +-
.../spark/streaming/StreamingContextSuite.scala | 6 +-
.../spark/streaming/rdd/MapWithStateRDDSuite.scala | 6 +-
.../streaming/receiver/BlockGeneratorSuite.scala | 16 +--
.../scheduler/ExecutorAllocationManagerSuite.scala | 2 +-
.../spark/streaming/util/WriteAheadLogSuite.scala | 2 +-
67 files changed, 325 insertions(+), 326 deletions(-)
diff --git a/core/src/main/scala/org/apache/spark/rpc/netty/Outbox.scala b/core/src/main/scala/org/apache/spark/rpc/netty/Outbox.scala
index b7e068a..3db6393 100644
--- a/core/src/main/scala/org/apache/spark/rpc/netty/Outbox.scala
+++ b/core/src/main/scala/org/apache/spark/rpc/netty/Outbox.scala
@@ -166,7 +166,7 @@ private[netty] class Outbox(nettyEnv: NettyRpcEnv, val address: RpcAddress) {
if (_client != null) {
message.sendWith(_client)
} else {
- assert(stopped == true)
+ assert(stopped)
}
} catch {
case NonFatal(e) =>
diff --git a/core/src/test/scala/org/apache/spark/CheckpointSuite.scala b/core/src/test/scala/org/apache/spark/CheckpointSuite.scala
index 0e019e4..3a43f1a 100644
--- a/core/src/test/scala/org/apache/spark/CheckpointSuite.scala
+++ b/core/src/test/scala/org/apache/spark/CheckpointSuite.scala
@@ -511,8 +511,8 @@ class CheckpointSuite extends SparkFunSuite with RDDCheckpointTester with LocalS
assert(rdd.isCheckpointed === false)
assert(rdd.isCheckpointedAndMaterialized === false)
assert(rdd.count() === 0)
- assert(rdd.isCheckpointed === true)
- assert(rdd.isCheckpointedAndMaterialized === true)
+ assert(rdd.isCheckpointed)
+ assert(rdd.isCheckpointedAndMaterialized)
assert(rdd.partitions.size === 0)
}
@@ -531,7 +531,7 @@ class CheckpointSuite extends SparkFunSuite with RDDCheckpointTester with LocalS
checkpoint(rdd2, reliableCheckpoint)
rdd2.count()
assert(rdd1.isCheckpointed === checkpointAllMarkedAncestors)
- assert(rdd2.isCheckpointed === true)
+ assert(rdd2.isCheckpointed)
} finally {
sc.setLocalProperty(RDD.CHECKPOINT_ALL_MARKED_ANCESTORS, null)
}
diff --git a/core/src/test/scala/org/apache/spark/DistributedSuite.scala b/core/src/test/scala/org/apache/spark/DistributedSuite.scala
index c0c8899..aad2054 100644
--- a/core/src/test/scala/org/apache/spark/DistributedSuite.scala
+++ b/core/src/test/scala/org/apache/spark/DistributedSuite.scala
@@ -322,9 +322,9 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex
val data = sc.parallelize(Seq(true, false, false, false), 4)
data.persist(StorageLevel.MEMORY_ONLY_2)
data.count
- assert(sc.persistentRdds.isEmpty === false)
+ assert(sc.persistentRdds.nonEmpty)
data.unpersist(blocking = true)
- assert(sc.persistentRdds.isEmpty === true)
+ assert(sc.persistentRdds.isEmpty)
failAfter(Span(3000, Millis)) {
try {
diff --git a/core/src/test/scala/org/apache/spark/FileSuite.scala b/core/src/test/scala/org/apache/spark/FileSuite.scala
index c540d7b..766cb0a 100644
--- a/core/src/test/scala/org/apache/spark/FileSuite.scala
+++ b/core/src/test/scala/org/apache/spark/FileSuite.scala
@@ -388,7 +388,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
sc = new SparkContext("local", "test")
val randomRDD = sc.parallelize(Array((1, "a"), (1, "a"), (2, "b"), (3, "c")), 1)
randomRDD.saveAsTextFile(tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-00000").exists())
intercept[FileAlreadyExistsException] {
randomRDD.saveAsTextFile(tempDir.getPath + "/output")
}
@@ -400,9 +400,9 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
sc = new SparkContext(conf)
val randomRDD = sc.parallelize(Array((1, "a"), (1, "a"), (2, "b"), (3, "c")), 1)
randomRDD.saveAsTextFile(tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-00000").exists())
randomRDD.saveAsTextFile(tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-00000").exists())
}
test ("prevent user from overwriting the empty directory (new Hadoop API)") {
@@ -420,7 +420,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
Array(("key1", "a"), ("key2", "a"), ("key3", "b"), ("key4", "c")), 1)
randomRDD.saveAsNewAPIHadoopFile[NewTextOutputFormat[String, String]](
tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-r-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-r-00000").exists())
intercept[FileAlreadyExistsException] {
randomRDD.saveAsNewAPIHadoopFile[NewTextOutputFormat[String, String]](tempDir.getPath)
}
@@ -434,10 +434,10 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
Array(("key1", "a"), ("key2", "a"), ("key3", "b"), ("key4", "c")), 1)
randomRDD.saveAsNewAPIHadoopFile[NewTextOutputFormat[String, String]](
tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-r-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-r-00000").exists())
randomRDD.saveAsNewAPIHadoopFile[NewTextOutputFormat[String, String]](
tempDir.getPath + "/output")
- assert(new File(tempDir.getPath + "/output/part-r-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/output/part-r-00000").exists())
}
test ("save Hadoop Dataset through old Hadoop API") {
@@ -450,7 +450,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
job.set("mapred.output.format.class", classOf[TextOutputFormat[String, String]].getName)
job.set("mapreduce.output.fileoutputformat.outputdir", tempDir.getPath + "/outputDataset_old")
randomRDD.saveAsHadoopDataset(job)
- assert(new File(tempDir.getPath + "/outputDataset_old/part-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/outputDataset_old/part-00000").exists())
}
test ("save Hadoop Dataset through new Hadoop API") {
@@ -465,7 +465,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
jobConfig.set("mapreduce.output.fileoutputformat.outputdir",
tempDir.getPath + "/outputDataset_new")
randomRDD.saveAsNewAPIHadoopDataset(jobConfig)
- assert(new File(tempDir.getPath + "/outputDataset_new/part-r-00000").exists() === true)
+ assert(new File(tempDir.getPath + "/outputDataset_new/part-r-00000").exists())
}
test("Get input files via old Hadoop API") {
@@ -572,7 +572,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
sc.parallelize(data, actualPartitionNum)
.saveAsHadoopFile[TextOutputFormat[String, String]](output.getPath)
for (i <- 0 until actualPartitionNum) {
- assert(new File(output, s"part-0000$i").exists() === true)
+ assert(new File(output, s"part-0000$i").exists())
}
val hadoopRDD = sc.textFile(new File(output, "part-*").getPath)
assert(hadoopRDD.partitions.length === expectedPartitionNum)
@@ -613,7 +613,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext {
sc.parallelize(data, actualPartitionNum)
.saveAsNewAPIHadoopFile[NewTextOutputFormat[String, String]](output.getPath)
for (i <- 0 until actualPartitionNum) {
- assert(new File(output, s"part-r-0000$i").exists() === true)
+ assert(new File(output, s"part-r-0000$i").exists())
}
val hadoopRDD = sc.newAPIHadoopFile(new File(output, "part-r-*").getPath,
classOf[NewTextInputFormat], classOf[LongWritable], classOf[Text])
diff --git a/core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala b/core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala
index 5dbfc5c..57d3397 100644
--- a/core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala
@@ -55,11 +55,11 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
val opts = SSLOptions.parse(conf, hadoopConf, "spark.ssl")
- assert(opts.enabled === true)
- assert(opts.trustStore.isDefined === true)
+ assert(opts.enabled)
+ assert(opts.trustStore.isDefined)
assert(opts.trustStore.get.getName === "truststore")
assert(opts.trustStore.get.getAbsolutePath === trustStorePath)
- assert(opts.keyStore.isDefined === true)
+ assert(opts.keyStore.isDefined)
assert(opts.keyStore.get.getName === "keystore")
assert(opts.keyStore.get.getAbsolutePath === keyStorePath)
assert(opts.trustStorePassword === Some("password"))
@@ -88,11 +88,11 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
val defaultOpts = SSLOptions.parse(conf, hadoopConf, "spark.ssl", defaults = None)
val opts = SSLOptions.parse(conf, hadoopConf, "spark.ssl.ui", defaults = Some(defaultOpts))
- assert(opts.enabled === true)
- assert(opts.trustStore.isDefined === true)
+ assert(opts.enabled)
+ assert(opts.trustStore.isDefined)
assert(opts.trustStore.get.getName === "truststore")
assert(opts.trustStore.get.getAbsolutePath === trustStorePath)
- assert(opts.keyStore.isDefined === true)
+ assert(opts.keyStore.isDefined)
assert(opts.keyStore.get.getName === "keystore")
assert(opts.keyStore.get.getAbsolutePath === keyStorePath)
assert(opts.trustStorePassword === Some("password"))
@@ -128,10 +128,10 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
assert(opts.enabled === false)
assert(opts.port === Some(4242))
- assert(opts.trustStore.isDefined === true)
+ assert(opts.trustStore.isDefined)
assert(opts.trustStore.get.getName === "truststore")
assert(opts.trustStore.get.getAbsolutePath === trustStorePath)
- assert(opts.keyStore.isDefined === true)
+ assert(opts.keyStore.isDefined)
assert(opts.keyStore.get.getName === "keystore")
assert(opts.keyStore.get.getAbsolutePath === keyStorePath)
assert(opts.trustStorePassword === Some("password"))
@@ -179,11 +179,11 @@ class SSLOptionsSuite extends SparkFunSuite with BeforeAndAfterAll {
val defaultOpts = SSLOptions.parse(conf, hadoopConf, "spark.ssl", defaults = None)
val opts = SSLOptions.parse(conf, hadoopConf, "spark.ssl.ui", defaults = Some(defaultOpts))
- assert(opts.enabled === true)
- assert(opts.trustStore.isDefined === true)
+ assert(opts.enabled)
+ assert(opts.trustStore.isDefined)
assert(opts.trustStore.get.getName === "truststore")
assert(opts.trustStore.get.getAbsolutePath === trustStorePath)
- assert(opts.keyStore.isDefined === true)
+ assert(opts.keyStore.isDefined)
assert(opts.keyStore.get.getName === "keystore")
assert(opts.keyStore.get.getAbsolutePath === keyStorePath)
assert(opts.trustStorePassword === Some("password"))
diff --git a/core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala b/core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala
index 9f0d2ac..2042145 100644
--- a/core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala
@@ -49,10 +49,10 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
conf.set(ACLS_ENABLE, true)
conf.set(UI_VIEW_ACLS, Seq("user1", "user2"))
val securityManager = new SecurityManager(conf)
- assert(securityManager.isAuthenticationEnabled() === true)
- assert(securityManager.aclsEnabled() === true)
- assert(securityManager.checkUIViewPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user2") === true)
+ assert(securityManager.isAuthenticationEnabled())
+ assert(securityManager.aclsEnabled())
+ assert(securityManager.checkUIViewPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user2"))
assert(securityManager.checkUIViewPermissions("user3") === false)
}
@@ -78,8 +78,8 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
val securityManager2 = new SecurityManager(conf2)
// group4,group5 do not match
- assert(securityManager2.checkUIViewPermissions("user1") === true)
- assert(securityManager2.checkUIViewPermissions("user2") === true)
+ assert(securityManager2.checkUIViewPermissions("user1"))
+ assert(securityManager2.checkUIViewPermissions("user2"))
val conf3 = new SparkConf
conf3.set(NETWORK_AUTH_ENABLED, true)
@@ -100,22 +100,22 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
conf.set(UI_VIEW_ACLS, Seq("user1", "user2"))
val securityManager = new SecurityManager(conf);
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
securityManager.setAcls(false)
assert(securityManager.aclsEnabled() === false)
// acls are off so doesn't matter what view acls set to
- assert(securityManager.checkUIViewPermissions("user4") === true)
+ assert(securityManager.checkUIViewPermissions("user4"))
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
securityManager.setViewAcls(Set[String]("user5"), Seq("user6", "user7"))
assert(securityManager.checkUIViewPermissions("user1") === false)
- assert(securityManager.checkUIViewPermissions("user5") === true)
- assert(securityManager.checkUIViewPermissions("user6") === true)
- assert(securityManager.checkUIViewPermissions("user7") === true)
+ assert(securityManager.checkUIViewPermissions("user5"))
+ assert(securityManager.checkUIViewPermissions("user6"))
+ assert(securityManager.checkUIViewPermissions("user7"))
assert(securityManager.checkUIViewPermissions("user8") === false)
- assert(securityManager.checkUIViewPermissions(null) === true)
+ assert(securityManager.checkUIViewPermissions(null))
}
test("set security with api for groups") {
@@ -127,8 +127,8 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
securityManager.setViewAclsGroups(Seq("group1", "group2"))
// group1,group2 match
- assert(securityManager.checkUIViewPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user2") === true)
+ assert(securityManager.checkUIViewPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user2"))
// change groups so they do not match
securityManager.setViewAclsGroups(Seq("group4", "group5"))
@@ -158,22 +158,22 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
val securityManager = new SecurityManager(conf);
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
securityManager.setAcls(false)
assert(securityManager.aclsEnabled() === false)
// acls are off so doesn't matter what view acls set to
- assert(securityManager.checkModifyPermissions("user4") === true)
+ assert(securityManager.checkModifyPermissions("user4"))
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
securityManager.setModifyAcls(Set("user5"), Seq("user6", "user7"))
assert(securityManager.checkModifyPermissions("user1") === false)
- assert(securityManager.checkModifyPermissions("user5") === true)
- assert(securityManager.checkModifyPermissions("user6") === true)
- assert(securityManager.checkModifyPermissions("user7") === true)
+ assert(securityManager.checkModifyPermissions("user5"))
+ assert(securityManager.checkModifyPermissions("user6"))
+ assert(securityManager.checkModifyPermissions("user7"))
assert(securityManager.checkModifyPermissions("user8") === false)
- assert(securityManager.checkModifyPermissions(null) === true)
+ assert(securityManager.checkModifyPermissions(null))
}
test("set security modify acls for groups") {
@@ -185,8 +185,8 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
securityManager.setModifyAclsGroups(Seq("group1", "group2"))
// group1,group2 match
- assert(securityManager.checkModifyPermissions("user1") === true)
- assert(securityManager.checkModifyPermissions("user2") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
+ assert(securityManager.checkModifyPermissions("user2"))
// change groups so they do not match
securityManager.setModifyAclsGroups(Seq("group4", "group5"))
@@ -196,8 +196,8 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
// change so they match again
securityManager.setModifyAclsGroups(Seq("group2", "group3"))
- assert(securityManager.checkModifyPermissions("user1") === true)
- assert(securityManager.checkModifyPermissions("user2") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
+ assert(securityManager.checkModifyPermissions("user2"))
}
test("set security admin acls") {
@@ -208,36 +208,36 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
val securityManager = new SecurityManager(conf)
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
- assert(securityManager.checkModifyPermissions("user1") === true)
- assert(securityManager.checkModifyPermissions("user2") === true)
- assert(securityManager.checkModifyPermissions("user4") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
+ assert(securityManager.checkModifyPermissions("user2"))
+ assert(securityManager.checkModifyPermissions("user4"))
assert(securityManager.checkModifyPermissions("user3") === false)
assert(securityManager.checkModifyPermissions("user5") === false)
- assert(securityManager.checkModifyPermissions(null) === true)
- assert(securityManager.checkUIViewPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user2") === true)
- assert(securityManager.checkUIViewPermissions("user3") === true)
+ assert(securityManager.checkModifyPermissions(null))
+ assert(securityManager.checkUIViewPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user2"))
+ assert(securityManager.checkUIViewPermissions("user3"))
assert(securityManager.checkUIViewPermissions("user4") === false)
assert(securityManager.checkUIViewPermissions("user5") === false)
- assert(securityManager.checkUIViewPermissions(null) === true)
+ assert(securityManager.checkUIViewPermissions(null))
securityManager.setAdminAcls(Seq("user6"))
securityManager.setViewAcls(Set[String]("user8"), Seq("user9"))
securityManager.setModifyAcls(Set("user11"), Seq("user9"))
- assert(securityManager.checkModifyPermissions("user6") === true)
- assert(securityManager.checkModifyPermissions("user11") === true)
- assert(securityManager.checkModifyPermissions("user9") === true)
+ assert(securityManager.checkModifyPermissions("user6"))
+ assert(securityManager.checkModifyPermissions("user11"))
+ assert(securityManager.checkModifyPermissions("user9"))
assert(securityManager.checkModifyPermissions("user1") === false)
assert(securityManager.checkModifyPermissions("user4") === false)
- assert(securityManager.checkModifyPermissions(null) === true)
- assert(securityManager.checkUIViewPermissions("user6") === true)
- assert(securityManager.checkUIViewPermissions("user8") === true)
- assert(securityManager.checkUIViewPermissions("user9") === true)
+ assert(securityManager.checkModifyPermissions(null))
+ assert(securityManager.checkUIViewPermissions("user6"))
+ assert(securityManager.checkUIViewPermissions("user8"))
+ assert(securityManager.checkUIViewPermissions("user9"))
assert(securityManager.checkUIViewPermissions("user1") === false)
assert(securityManager.checkUIViewPermissions("user3") === false)
- assert(securityManager.checkUIViewPermissions(null) === true)
+ assert(securityManager.checkUIViewPermissions(null))
}
test("set security admin acls for groups") {
@@ -249,11 +249,11 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
val securityManager = new SecurityManager(conf)
securityManager.setAcls(true)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
// group1,group2,group3 match
- assert(securityManager.checkModifyPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user1") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user1"))
// change admin groups so they do not match. view and modify groups are set to admin groups
securityManager.setAdminAclsGroups(Seq("group4", "group5"))
@@ -266,14 +266,14 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
// change modify groups so they match
securityManager.setModifyAclsGroups(Seq("group3"))
- assert(securityManager.checkModifyPermissions("user1") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
assert(securityManager.checkUIViewPermissions("user1") === false)
// change view groups so they match
securityManager.setViewAclsGroups(Seq("group2"))
securityManager.setModifyAclsGroups(Seq("group4"))
assert(securityManager.checkModifyPermissions("user1") === false)
- assert(securityManager.checkUIViewPermissions("user1") === true)
+ assert(securityManager.checkUIViewPermissions("user1"))
// change modify and view groups so they do not match
securityManager.setViewAclsGroups(Seq("group7"))
@@ -290,20 +290,20 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
conf.set(MODIFY_ACLS, Seq("user4"))
val securityManager = new SecurityManager(conf)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
// check for viewAcls with *
- assert(securityManager.checkUIViewPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user5") === true)
- assert(securityManager.checkUIViewPermissions("user6") === true)
- assert(securityManager.checkModifyPermissions("user4") === true)
+ assert(securityManager.checkUIViewPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user5"))
+ assert(securityManager.checkUIViewPermissions("user6"))
+ assert(securityManager.checkModifyPermissions("user4"))
assert(securityManager.checkModifyPermissions("user7") === false)
assert(securityManager.checkModifyPermissions("user8") === false)
// check for modifyAcls with *
securityManager.setModifyAcls(Set("user4"), Seq("*"))
- assert(securityManager.checkModifyPermissions("user7") === true)
- assert(securityManager.checkModifyPermissions("user8") === true)
+ assert(securityManager.checkModifyPermissions("user7"))
+ assert(securityManager.checkModifyPermissions("user8"))
securityManager.setAdminAcls(Seq("user1", "user2"))
securityManager.setModifyAcls(Set("user1"), Seq("user2"))
@@ -317,10 +317,10 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
securityManager.setAdminAcls(Seq("user1", "*"))
securityManager.setModifyAcls(Set("user1"), Seq("user2"))
securityManager.setViewAcls(Set("user1"), Seq("user2"))
- assert(securityManager.checkUIViewPermissions("user5") === true)
- assert(securityManager.checkUIViewPermissions("user6") === true)
- assert(securityManager.checkModifyPermissions("user7") === true)
- assert(securityManager.checkModifyPermissions("user8") === true)
+ assert(securityManager.checkUIViewPermissions("user5"))
+ assert(securityManager.checkUIViewPermissions("user6"))
+ assert(securityManager.checkModifyPermissions("user7"))
+ assert(securityManager.checkModifyPermissions("user8"))
}
test("set security with * in acls for groups") {
@@ -331,11 +331,11 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
conf.set(MODIFY_ACLS_GROUPS, Seq("group6"))
val securityManager = new SecurityManager(conf)
- assert(securityManager.aclsEnabled() === true)
+ assert(securityManager.aclsEnabled())
// check for viewAclsGroups with *
- assert(securityManager.checkUIViewPermissions("user1") === true)
- assert(securityManager.checkUIViewPermissions("user2") === true)
+ assert(securityManager.checkUIViewPermissions("user1"))
+ assert(securityManager.checkUIViewPermissions("user2"))
assert(securityManager.checkModifyPermissions("user1") === false)
assert(securityManager.checkModifyPermissions("user2") === false)
@@ -344,17 +344,17 @@ class SecurityManagerSuite extends SparkFunSuite with ResetSystemProperties {
securityManager.setViewAclsGroups(Seq("group6"))
assert(securityManager.checkUIViewPermissions("user1") === false)
assert(securityManager.checkUIViewPermissions("user2") === false)
- assert(securityManager.checkModifyPermissions("user1") === true)
- assert(securityManager.checkModifyPermissions("user2") === true)
+ assert(securityManager.checkModifyPermissions("user1"))
+ assert(securityManager.checkModifyPermissions("user2"))
// check for adminAcls with *
securityManager.setAdminAclsGroups(Seq("group9", "*"))
securityManager.setModifyAclsGroups(Seq("group4", "group5"))
securityManager.setViewAclsGroups(Seq("group6", "group7"))
- assert(securityManager.checkUIViewPermissions("user5") === true)
- assert(securityManager.checkUIViewPermissions("user6") === true)
- assert(securityManager.checkModifyPermissions("user7") === true)
- assert(securityManager.checkModifyPermissions("user8") === true)
+ assert(securityManager.checkUIViewPermissions("user5"))
+ assert(securityManager.checkUIViewPermissions("user6"))
+ assert(securityManager.checkModifyPermissions("user7"))
+ assert(securityManager.checkModifyPermissions("user8"))
}
test("security for groups default behavior") {
diff --git a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
index ea31a75..4ba8a3a 100644
--- a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
@@ -173,7 +173,7 @@ class SparkConfSuite extends SparkFunSuite with LocalSparkContext with ResetSyst
val t0 = System.nanoTime()
while ((System.nanoTime() - t0) < TimeUnit.SECONDS.toNanos(1)) {
val conf = Try(new SparkConf(loadDefaults = true))
- assert(conf.isSuccess === true)
+ assert(conf.isSuccess)
}
} finally {
executor.shutdownNow()
diff --git a/core/src/test/scala/org/apache/spark/SparkContextInfoSuite.scala b/core/src/test/scala/org/apache/spark/SparkContextInfoSuite.scala
index 051a13c..a57afdf 100644
--- a/core/src/test/scala/org/apache/spark/SparkContextInfoSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkContextInfoSuite.scala
@@ -24,10 +24,10 @@ import org.apache.spark.storage.StorageLevel
class SparkContextInfoSuite extends SparkFunSuite with LocalSparkContext {
test("getPersistentRDDs only returns RDDs that are marked as cached") {
sc = new SparkContext("local", "test")
- assert(sc.getPersistentRDDs.isEmpty === true)
+ assert(sc.getPersistentRDDs.isEmpty)
val rdd = sc.makeRDD(Array(1, 2, 3, 4), 2)
- assert(sc.getPersistentRDDs.isEmpty === true)
+ assert(sc.getPersistentRDDs.isEmpty)
rdd.cache()
assert(sc.getPersistentRDDs.size === 1)
diff --git a/core/src/test/scala/org/apache/spark/UnpersistSuite.scala b/core/src/test/scala/org/apache/spark/UnpersistSuite.scala
index 2432d6d..ff6ee79 100644
--- a/core/src/test/scala/org/apache/spark/UnpersistSuite.scala
+++ b/core/src/test/scala/org/apache/spark/UnpersistSuite.scala
@@ -29,9 +29,9 @@ class UnpersistSuite extends SparkFunSuite with LocalSparkContext with TimeLimit
sc = new SparkContext("local", "test")
val rdd = sc.makeRDD(Array(1, 2, 3, 4), 2).cache()
rdd.count
- assert(sc.persistentRdds.isEmpty === false)
+ assert(sc.persistentRdds.nonEmpty)
rdd.unpersist(blocking = true)
- assert(sc.persistentRdds.isEmpty === true)
+ assert(sc.persistentRdds.isEmpty)
failAfter(Span(3000, Millis)) {
try {
@@ -44,6 +44,6 @@ class UnpersistSuite extends SparkFunSuite with LocalSparkContext with TimeLimit
// is racing this thread to remove entries from the driver.
}
}
- assert(sc.getRDDStorageInfo.isEmpty === true)
+ assert(sc.getRDDStorageInfo.isEmpty)
}
}
diff --git a/core/src/test/scala/org/apache/spark/rdd/RDDBarrierSuite.scala b/core/src/test/scala/org/apache/spark/rdd/RDDBarrierSuite.scala
index d57ea4d..2f6c4d6 100644
--- a/core/src/test/scala/org/apache/spark/rdd/RDDBarrierSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rdd/RDDBarrierSuite.scala
@@ -26,13 +26,13 @@ class RDDBarrierSuite extends SparkFunSuite with SharedSparkContext {
assert(rdd.isBarrier() === false)
val rdd2 = rdd.barrier().mapPartitions(iter => iter)
- assert(rdd2.isBarrier() === true)
+ assert(rdd2.isBarrier())
}
test("create an RDDBarrier in the middle of a chain of RDDs") {
val rdd = sc.parallelize(1 to 10, 4).map(x => x * 2)
val rdd2 = rdd.barrier().mapPartitions(iter => iter).map(x => (x, x + 1))
- assert(rdd2.isBarrier() === true)
+ assert(rdd2.isBarrier())
}
test("RDDBarrier with shuffle") {
diff --git a/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
index e957340..557cb11 100644
--- a/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
@@ -142,7 +142,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext {
val actual = parallelUnion.collect().toList
sc.conf.remove(RDD_PARALLEL_LISTING_THRESHOLD.key)
- assert(parallelUnion.asInstanceOf[UnionRDD[Int]].isPartitionListingParallel === true)
+ assert(parallelUnion.asInstanceOf[UnionRDD[Int]].isPartitionListingParallel)
assert(expected === actual)
}
@@ -445,7 +445,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext {
val splits = coalesced1.glom().collect().map(_.toList).toList
assert(splits.length === 3, "Supposed to coalesce to 3 but got " + splits.length)
- assert(splits.forall(_.length >= 1) === true, "Some partitions were empty")
+ assert(splits.forall(_.length >= 1), "Some partitions were empty")
// If we try to coalesce into more partitions than the original RDD, it should just
// keep the original number of partitions.
@@ -472,7 +472,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext {
val splits = coalesced1.glom().collect().map(_.toList).toList
assert(splits.length === 3, "Supposed to coalesce to 3 but got " + splits.length)
- assert(splits.forall(_.length >= 1) === true, "Some partitions were empty")
+ assert(splits.forall(_.length >= 1), "Some partitions were empty")
// If we try to coalesce into more partitions than the original RDD, it should just
// keep the original number of partitions.
diff --git a/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala b/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala
index 1b7f166..178d420 100644
--- a/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala
@@ -305,7 +305,7 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll {
eventually(timeout(5 seconds), interval(10 millis)) {
// Calling `self` in `onStart` is fine
- assert(callSelfSuccessfully === true)
+ assert(callSelfSuccessfully)
}
}
@@ -326,7 +326,7 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll {
eventually(timeout(5 seconds), interval(10 millis)) {
// Calling `self` in `receive` is fine
- assert(callSelfSuccessfully === true)
+ assert(callSelfSuccessfully)
}
}
diff --git a/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala
index b31b8cf..480e861 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala
@@ -110,7 +110,7 @@ class CoarseGrainedSchedulerBackendSuite extends SparkFunSuite with LocalSparkCo
eventually(timeout(10.seconds)) {
// Ensure some tasks have started and no task finished, so some executors must be busy.
- assert(taskStarted.get() == true)
+ assert(taskStarted.get())
assert(taskEnded.get() == false)
// Assert we count in slots on both busy and free executors.
assert(sc.maxNumConcurrentTasks() == 4)
diff --git a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
index ed6a3d9..e17d264 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
@@ -890,7 +890,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
// Confirm job finished successfully
sc.listenerBus.waitUntilEmpty(1000)
- assert(ended === true)
+ assert(ended)
assert(results === (0 until parts).map { idx => idx -> 42 }.toMap)
assertDataStructuresEmpty()
}
@@ -1049,7 +1049,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
assertDataStructuresEmpty()
sc.listenerBus.waitUntilEmpty(1000)
- assert(ended === true)
+ assert(ended)
assert(results === Map(0 -> 42))
}
diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala
index 2736975..2f67777 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala
@@ -72,7 +72,7 @@ class TaskContextSuite extends SparkFunSuite with BeforeAndAfter with LocalSpark
intercept[RuntimeException] {
task.run(0, 0, null)
}
- assert(TaskContextSuite.completed === true)
+ assert(TaskContextSuite.completed)
}
test("calls TaskFailureListeners after failure") {
diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
index 60acd3e..32a2bdb 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
@@ -736,7 +736,7 @@ class TaskSetManagerSuite extends SparkFunSuite with LocalSparkContext with Logg
// Complete one copy of the task, which should result in the task set manager
// being marked as a zombie, because at least one copy of its only task has completed.
manager.handleSuccessfulTask(task1.taskId, directTaskResult)
- assert(manager.isZombie === true)
+ assert(manager.isZombie)
assert(resubmittedTasks === 0)
assert(manager.runningTasks === 1)
diff --git a/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala b/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala
index 9469a46..9f51bd7 100644
--- a/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala
@@ -294,7 +294,7 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter {
assert(executorStageSummaryWrappersForNode.nonEmpty)
executorStageSummaryWrappersForNode.foreach { exec =>
// both executor is expected to be blacklisted
- assert(exec.info.isBlacklistedForStage === true)
+ assert(exec.info.isBlacklistedForStage)
}
// Fail one of the tasks, re-start it.
diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala
index ac35ac3..5dec4f5 100644
--- a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala
@@ -411,7 +411,7 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE
val reregister = !master.driverEndpoint.askSync[Boolean](
BlockManagerHeartbeat(store.blockManagerId))
- assert(reregister == true)
+ assert(reregister)
}
test("reregistration on block update") {
diff --git a/core/src/test/scala/org/apache/spark/util/BoundedPriorityQueueSuite.scala b/core/src/test/scala/org/apache/spark/util/BoundedPriorityQueueSuite.scala
index 9465ca7..3417601 100644
--- a/core/src/test/scala/org/apache/spark/util/BoundedPriorityQueueSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/BoundedPriorityQueueSuite.scala
@@ -29,12 +29,12 @@ class BoundedPriorityQueueSuite extends SparkFunSuite {
pq += 0.3
pq += 0.01
- assert(pq.isEmpty == false)
+ assert(pq.nonEmpty)
assert(pq.poll() == 0.1)
assert(pq.poll() == 0.3)
assert(pq.poll() == 1.0)
assert(pq.poll() == 1.5)
- assert(pq.isEmpty == true)
+ assert(pq.isEmpty)
val pq2 = new BoundedPriorityQueue[(Int, Double)](4)(Ordering.by(_._2))
pq2 += 1 -> 0.5
diff --git a/core/src/test/scala/org/apache/spark/util/ThreadUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/ThreadUtilsSuite.scala
index 604f1e1..c181553 100644
--- a/core/src/test/scala/org/apache/spark/util/ThreadUtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/ThreadUtilsSuite.scala
@@ -116,7 +116,7 @@ class ThreadUtilsSuite extends SparkFunSuite {
test("runInNewThread") {
import ThreadUtils._
assert(runInNewThread("thread-name") { Thread.currentThread().getName } === "thread-name")
- assert(runInNewThread("thread-name") { Thread.currentThread().isDaemon } === true)
+ assert(runInNewThread("thread-name") { Thread.currentThread().isDaemon })
assert(
runInNewThread("thread-name", isDaemon = false) { Thread.currentThread().isDaemon } === false
)
@@ -126,7 +126,7 @@ class ThreadUtilsSuite extends SparkFunSuite {
}
assert(exception.asInstanceOf[IllegalArgumentException].getMessage === uniqueExceptionMessage)
assert(exception.getStackTrace.mkString("\n").contains(
- "... run in separate thread using org.apache.spark.util.ThreadUtils ...") === true,
+ "... run in separate thread using org.apache.spark.util.ThreadUtils ..."),
"stack trace does not contain expected place holder"
)
assert(exception.getStackTrace.mkString("\n").contains("ThreadUtils.scala") === false,
diff --git a/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadSuite.scala b/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadSuite.scala
index 6a190f6..9c0ee1e 100644
--- a/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadSuite.scala
@@ -56,7 +56,7 @@ class UninterruptibleThreadSuite extends SparkFunSuite {
t.interrupt()
t.join()
assert(hasInterruptedException === false)
- assert(interruptStatusBeforeExit === true)
+ assert(interruptStatusBeforeExit)
}
test("interrupt before runUninterruptibly runs") {
@@ -80,7 +80,7 @@ class UninterruptibleThreadSuite extends SparkFunSuite {
interruptLatch.countDown()
t.join()
assert(hasInterruptedException === false)
- assert(interruptStatusBeforeExit === true)
+ assert(interruptStatusBeforeExit)
}
test("nested runUninterruptibly") {
@@ -112,7 +112,7 @@ class UninterruptibleThreadSuite extends SparkFunSuite {
interruptLatch.countDown()
t.join()
assert(hasInterruptedException === false)
- assert(interruptStatusBeforeExit === true)
+ assert(interruptStatusBeforeExit)
}
test("stress test") {
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
index fdd9771..188e3f6 100644
--- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
@@ -619,7 +619,7 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
.filter { case (k, v) => k.startsWith("spark.")}
.foreach { case (k, v) => sys.props.getOrElseUpdate(k, v)}
val sparkConf = new SparkConf
- assert(sparkConf.getBoolean("spark.test.fileNameLoadA", false) === true)
+ assert(sparkConf.getBoolean("spark.test.fileNameLoadA", false))
assert(sparkConf.getInt("spark.test.fileNameLoadB", 1) === 2)
}
}
@@ -835,11 +835,11 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
assert(Utils.isDynamicAllocationEnabled(
conf.set(DYN_ALLOCATION_ENABLED, false)) === false)
assert(Utils.isDynamicAllocationEnabled(
- conf.set(DYN_ALLOCATION_ENABLED, true)) === true)
+ conf.set(DYN_ALLOCATION_ENABLED, true)))
assert(Utils.isDynamicAllocationEnabled(
- conf.set("spark.executor.instances", "1")) === true)
+ conf.set("spark.executor.instances", "1")))
assert(Utils.isDynamicAllocationEnabled(
- conf.set("spark.executor.instances", "0")) === true)
+ conf.set("spark.executor.instances", "0")))
assert(Utils.isDynamicAllocationEnabled(conf.set("spark.master", "local")) === false)
assert(Utils.isDynamicAllocationEnabled(conf.set(DYN_ALLOCATION_TESTING, true)))
}
diff --git a/core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala
index 6b4e928..b28489a 100644
--- a/core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala
@@ -113,7 +113,7 @@ class AppendOnlyMapSuite extends SparkFunSuite {
assert(map.size === 100)
for (i <- 1 to 100) {
val res = map.changeValue("" + i, (hadValue, oldValue) => {
- assert(hadValue === true)
+ assert(hadValue)
assert(oldValue === "" + i)
oldValue + "!"
})
@@ -136,7 +136,7 @@ class AppendOnlyMapSuite extends SparkFunSuite {
})
assert(map.size === 401)
map.changeValue(null, (hadValue, oldValue) => {
- assert(hadValue === true)
+ assert(hadValue)
assert(oldValue === "null!")
"null!!"
})
diff --git a/external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala b/external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala
index 6d27445..5733721 100644
--- a/external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala
+++ b/external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisStreamSuite.scala
@@ -152,7 +152,7 @@ abstract class KinesisStreamTests(aggregateTestData: Boolean) extends KinesisFun
_.asInstanceOf[KinesisBackedBlockRDDPartition] }.toSeq
assert(partitions.map { _.seqNumberRanges } === Seq(seqNumRanges1, seqNumRanges2))
assert(partitions.map { _.blockId } === Seq(blockId1, blockId2))
- assert(partitions.forall { _.isBlockIdValid === true })
+ assert(partitions.forall { _.isBlockIdValid })
// Verify that KinesisBackedBlockRDD is generated even when there are no blocks
val emptyRDD = kinesisStream.createBlockRDD(time, Seq.empty)
diff --git a/mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderSuite.scala
index d92313f..70f8c02 100644
--- a/mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderSuite.scala
@@ -52,7 +52,7 @@ class OneHotEncoderSuite extends MLTest with DefaultReadWriteTest {
val encoder = new OneHotEncoder()
.setInputCols(Array("input"))
.setOutputCols(Array("output"))
- assert(encoder.getDropLast === true)
+ assert(encoder.getDropLast)
encoder.setDropLast(false)
assert(encoder.getDropLast === false)
val model = encoder.fit(df)
@@ -193,7 +193,7 @@ class OneHotEncoderSuite extends MLTest with DefaultReadWriteTest {
val encoder = new OneHotEncoder()
.setInputCols(Array("input1", "input2"))
.setOutputCols(Array("output1", "output2"))
- assert(encoder.getDropLast === true)
+ assert(encoder.getDropLast)
encoder.setDropLast(false)
assert(encoder.getDropLast === false)
diff --git a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtilsSuite.scala b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtilsSuite.scala
index c079089..16fba35 100644
--- a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtilsSuite.scala
+++ b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/KubernetesVolumeUtilsSuite.scala
@@ -28,7 +28,7 @@ class KubernetesVolumeUtilsSuite extends SparkFunSuite {
val volumeSpec = KubernetesVolumeUtils.parseVolumesWithPrefix(sparkConf, "test.").head
assert(volumeSpec.volumeName === "volumeName")
assert(volumeSpec.mountPath === "/path")
- assert(volumeSpec.mountReadOnly === true)
+ assert(volumeSpec.mountReadOnly)
assert(volumeSpec.volumeConf.asInstanceOf[KubernetesHostPathVolumeConf] ===
KubernetesHostPathVolumeConf("/hostPath"))
}
@@ -54,7 +54,7 @@ class KubernetesVolumeUtilsSuite extends SparkFunSuite {
val volumeSpec = KubernetesVolumeUtils.parseVolumesWithPrefix(sparkConf, "test.").head
assert(volumeSpec.volumeName === "volumeName")
assert(volumeSpec.mountPath === "/path")
- assert(volumeSpec.mountReadOnly === true)
+ assert(volumeSpec.mountReadOnly)
assert(volumeSpec.volumeConf.asInstanceOf[KubernetesPVCVolumeConf] ===
KubernetesPVCVolumeConf("claimeName"))
}
@@ -69,7 +69,7 @@ class KubernetesVolumeUtilsSuite extends SparkFunSuite {
val volumeSpec = KubernetesVolumeUtils.parseVolumesWithPrefix(sparkConf, "test.").head
assert(volumeSpec.volumeName === "volumeName")
assert(volumeSpec.mountPath === "/path")
- assert(volumeSpec.mountReadOnly === true)
+ assert(volumeSpec.mountReadOnly)
assert(volumeSpec.volumeConf.asInstanceOf[KubernetesEmptyDirVolumeConf] ===
KubernetesEmptyDirVolumeConf(Some("medium"), Some("5G")))
}
@@ -82,7 +82,7 @@ class KubernetesVolumeUtilsSuite extends SparkFunSuite {
val volumeSpec = KubernetesVolumeUtils.parseVolumesWithPrefix(sparkConf, "test.").head
assert(volumeSpec.volumeName === "volumeName")
assert(volumeSpec.mountPath === "/path")
- assert(volumeSpec.mountReadOnly === true)
+ assert(volumeSpec.mountReadOnly)
assert(volumeSpec.volumeConf.asInstanceOf[KubernetesEmptyDirVolumeConf] ===
KubernetesEmptyDirVolumeConf(None, None))
}
diff --git a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStepSuite.scala b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStepSuite.scala
index cb4cccc..93268c6 100644
--- a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStepSuite.scala
+++ b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStepSuite.scala
@@ -197,7 +197,7 @@ class BasicExecutorFeatureStepSuite extends SparkFunSuite with BeforeAndAfter {
private def checkOwnerReferences(executor: Pod, driverPodUid: String): Unit = {
assert(executor.getMetadata.getOwnerReferences.size() === 1)
assert(executor.getMetadata.getOwnerReferences.get(0).getUid === driverPodUid)
- assert(executor.getMetadata.getOwnerReferences.get(0).getController === true)
+ assert(executor.getMetadata.getOwnerReferences.get(0).getController)
}
// Check that the expected environment variables are present.
diff --git a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/MountVolumesFeatureStepSuite.scala b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/MountVolumesFeatureStepSuite.scala
index e6f1dd6..8c430ee 100644
--- a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/MountVolumesFeatureStepSuite.scala
+++ b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/MountVolumesFeatureStepSuite.scala
@@ -60,7 +60,7 @@ class MountVolumesFeatureStepSuite extends SparkFunSuite {
assert(configuredPod.container.getVolumeMounts.size() === 1)
assert(configuredPod.container.getVolumeMounts.get(0).getMountPath === "/tmp")
assert(configuredPod.container.getVolumeMounts.get(0).getName === "testVolume")
- assert(configuredPod.container.getVolumeMounts.get(0).getReadOnly === true)
+ assert(configuredPod.container.getVolumeMounts.get(0).getReadOnly)
}
diff --git a/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorBlacklistTrackerSuite.scala b/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorBlacklistTrackerSuite.scala
index 2019107..259d758 100644
--- a/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorBlacklistTrackerSuite.scala
+++ b/resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorBlacklistTrackerSuite.scala
@@ -135,6 +135,6 @@ class YarnAllocatorBlacklistTrackerSuite extends SparkFunSuite with Matchers
yarnBlacklistTracker.handleResourceAllocationFailure(Some("host4"))
verify(amClientMock).updateBlacklist(Arrays.asList("host4"), Collections.emptyList())
- assert(yarnBlacklistTracker.isAllNodeBlacklisted === true)
+ assert(yarnBlacklistTracker.isAllNodeBlacklisted)
}
}
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
index 51e0f4b..db272b3 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala
@@ -34,7 +34,7 @@ abstract class LogicalPlan
with Logging {
/** Returns true if this subtree has data from a streaming data source. */
- def isStreaming: Boolean = children.exists(_.isStreaming == true)
+ def isStreaming: Boolean = children.exists(_.isStreaming)
override def verboseStringWithSuffix(maxFields: Int): String = {
super.verboseString(maxFields) + statsCache.map(", " + _.toString).getOrElse("")
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala
index bd87ca6..79fc38c 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecisionSuite.scala
@@ -174,18 +174,18 @@ class DecimalPrecisionSuite extends AnalysisTest with BeforeAndAfter {
assert(d0.isWiderThan(d1) === false)
assert(d1.isWiderThan(d0) === false)
assert(d1.isWiderThan(d2) === false)
- assert(d2.isWiderThan(d1) === true)
+ assert(d2.isWiderThan(d1))
assert(d2.isWiderThan(d3) === false)
- assert(d3.isWiderThan(d2) === true)
- assert(d4.isWiderThan(d3) === true)
+ assert(d3.isWiderThan(d2))
+ assert(d4.isWiderThan(d3))
assert(d1.isWiderThan(ByteType) === false)
- assert(d2.isWiderThan(ByteType) === true)
+ assert(d2.isWiderThan(ByteType))
assert(d2.isWiderThan(ShortType) === false)
- assert(d3.isWiderThan(ShortType) === true)
- assert(d3.isWiderThan(IntegerType) === true)
+ assert(d3.isWiderThan(ShortType))
+ assert(d3.isWiderThan(IntegerType))
assert(d3.isWiderThan(LongType) === false)
- assert(d4.isWiderThan(LongType) === true)
+ assert(d4.isWiderThan(LongType))
assert(d4.isWiderThan(FloatType) === false)
assert(d4.isWiderThan(DoubleType) === false)
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
index be8fd90..1b00506 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
@@ -329,8 +329,8 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes
{
val schema = ExpressionEncoder[(Int, (String, Int))].schema
assert(schema(0).nullable === false)
- assert(schema(1).nullable === true)
- assert(schema(1).dataType.asInstanceOf[StructType](0).nullable === true)
+ assert(schema(1).nullable)
+ assert(schema(1).dataType.asInstanceOf[StructType](0).nullable)
assert(schema(1).dataType.asInstanceOf[StructType](1).nullable === false)
}
@@ -340,8 +340,8 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes
ExpressionEncoder[Int],
ExpressionEncoder[(String, Int)]).schema
assert(schema(0).nullable === false)
- assert(schema(1).nullable === true)
- assert(schema(1).dataType.asInstanceOf[StructType](0).nullable === true)
+ assert(schema(1).nullable)
+ assert(schema(1).dataType.asInstanceOf[StructType](0).nullable)
assert(schema(1).dataType.asInstanceOf[StructType](1).nullable === false)
}
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/AttributeSetSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/AttributeSetSuite.scala
index b6e8b66..ca855af 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/AttributeSetSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/AttributeSetSuite.scala
@@ -39,8 +39,8 @@ class AttributeSetSuite extends SparkFunSuite {
}
test("checks by id not name") {
- assert(aSet.contains(aUpper) === true)
- assert(aSet.contains(aLower) === true)
+ assert(aSet.contains(aUpper))
+ assert(aSet.contains(aLower))
assert(aSet.contains(fakeA) === false)
assert(aSet.contains(bUpper) === false)
@@ -48,8 +48,8 @@ class AttributeSetSuite extends SparkFunSuite {
}
test("++ preserves AttributeSet") {
- assert((aSet ++ bSet).contains(aUpper) === true)
- assert((aSet ++ bSet).contains(aLower) === true)
+ assert((aSet ++ bSet).contains(aUpper))
+ assert((aSet ++ bSet).contains(aLower))
}
test("extracts all references ") {
@@ -65,7 +65,7 @@ class AttributeSetSuite extends SparkFunSuite {
}
test("subset") {
- assert(aSet.subsetOf(aAndBSet) === true)
+ assert(aSet.subsetOf(aAndBSet))
assert(aAndBSet.subsetOf(aSet) === false)
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
index d812504..1b7f258 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
@@ -293,16 +293,16 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
test("cast from string") {
assert(cast("abcdef", StringType).nullable === false)
assert(cast("abcdef", BinaryType).nullable === false)
- assert(cast("abcdef", BooleanType).nullable === true)
- assert(cast("abcdef", TimestampType).nullable === true)
- assert(cast("abcdef", LongType).nullable === true)
- assert(cast("abcdef", IntegerType).nullable === true)
- assert(cast("abcdef", ShortType).nullable === true)
- assert(cast("abcdef", ByteType).nullable === true)
- assert(cast("abcdef", DecimalType.USER_DEFAULT).nullable === true)
- assert(cast("abcdef", DecimalType(4, 2)).nullable === true)
- assert(cast("abcdef", DoubleType).nullable === true)
- assert(cast("abcdef", FloatType).nullable === true)
+ assert(cast("abcdef", BooleanType).nullable)
+ assert(cast("abcdef", TimestampType).nullable)
+ assert(cast("abcdef", LongType).nullable)
+ assert(cast("abcdef", IntegerType).nullable)
+ assert(cast("abcdef", ShortType).nullable)
+ assert(cast("abcdef", ByteType).nullable)
+ assert(cast("abcdef", DecimalType.USER_DEFAULT).nullable)
+ assert(cast("abcdef", DecimalType(4, 2)).nullable)
+ assert(cast("abcdef", DoubleType).nullable)
+ assert(cast("abcdef", FloatType).nullable)
}
test("data type casting") {
@@ -402,33 +402,33 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
test("casting to fixed-precision decimals") {
assert(cast(123, DecimalType.USER_DEFAULT).nullable === false)
- assert(cast(10.03f, DecimalType.SYSTEM_DEFAULT).nullable === true)
- assert(cast(10.03, DecimalType.SYSTEM_DEFAULT).nullable === true)
+ assert(cast(10.03f, DecimalType.SYSTEM_DEFAULT).nullable)
+ assert(cast(10.03, DecimalType.SYSTEM_DEFAULT).nullable)
assert(cast(Decimal(10.03), DecimalType.SYSTEM_DEFAULT).nullable === false)
- assert(cast(123, DecimalType(2, 1)).nullable === true)
- assert(cast(10.03f, DecimalType(2, 1)).nullable === true)
- assert(cast(10.03, DecimalType(2, 1)).nullable === true)
- assert(cast(Decimal(10.03), DecimalType(2, 1)).nullable === true)
+ assert(cast(123, DecimalType(2, 1)).nullable)
+ assert(cast(10.03f, DecimalType(2, 1)).nullable)
+ assert(cast(10.03, DecimalType(2, 1)).nullable)
+ assert(cast(Decimal(10.03), DecimalType(2, 1)).nullable)
assert(cast(123, DecimalType.IntDecimal).nullable === false)
- assert(cast(10.03f, DecimalType.FloatDecimal).nullable === true)
- assert(cast(10.03, DecimalType.DoubleDecimal).nullable === true)
+ assert(cast(10.03f, DecimalType.FloatDecimal).nullable)
+ assert(cast(10.03, DecimalType.DoubleDecimal).nullable)
assert(cast(Decimal(10.03), DecimalType(4, 2)).nullable === false)
assert(cast(Decimal(10.03), DecimalType(5, 3)).nullable === false)
- assert(cast(Decimal(10.03), DecimalType(3, 1)).nullable === true)
+ assert(cast(Decimal(10.03), DecimalType(3, 1)).nullable)
assert(cast(Decimal(10.03), DecimalType(4, 1)).nullable === false)
- assert(cast(Decimal(9.95), DecimalType(2, 1)).nullable === true)
+ assert(cast(Decimal(9.95), DecimalType(2, 1)).nullable)
assert(cast(Decimal(9.95), DecimalType(3, 1)).nullable === false)
- assert(cast(Decimal("1003"), DecimalType(3, -1)).nullable === true)
+ assert(cast(Decimal("1003"), DecimalType(3, -1)).nullable)
assert(cast(Decimal("1003"), DecimalType(4, -1)).nullable === false)
- assert(cast(Decimal("995"), DecimalType(2, -1)).nullable === true)
+ assert(cast(Decimal("995"), DecimalType(2, -1)).nullable)
assert(cast(Decimal("995"), DecimalType(3, -1)).nullable === false)
assert(cast(true, DecimalType.SYSTEM_DEFAULT).nullable === false)
- assert(cast(true, DecimalType(1, 1)).nullable === true)
+ assert(cast(true, DecimalType(1, 1)).nullable)
checkEvaluation(cast(10.03, DecimalType.SYSTEM_DEFAULT), Decimal(10.03))
@@ -555,7 +555,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
{
val ret = cast(array, ArrayType(IntegerType, containsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Seq(123, null, null, null))
}
{
@@ -564,7 +564,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
}
{
val ret = cast(array, ArrayType(BooleanType, containsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Seq(null, true, false, null))
}
{
@@ -574,7 +574,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
{
val ret = cast(array_notNull, ArrayType(IntegerType, containsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Seq(123, null, null))
}
{
@@ -583,7 +583,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
}
{
val ret = cast(array_notNull, ArrayType(BooleanType, containsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Seq(null, true, false))
}
{
@@ -609,7 +609,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
{
val ret = cast(map, MapType(StringType, IntegerType, valueContainsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Map("a" -> 123, "b" -> null, "c" -> null, "d" -> null))
}
{
@@ -618,7 +618,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
}
{
val ret = cast(map, MapType(StringType, BooleanType, valueContainsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Map("a" -> null, "b" -> true, "c" -> false, "d" -> null))
}
{
@@ -632,7 +632,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
{
val ret = cast(map_notNull, MapType(StringType, IntegerType, valueContainsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Map("a" -> 123, "b" -> null, "c" -> null))
}
{
@@ -641,7 +641,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
}
{
val ret = cast(map_notNull, MapType(StringType, BooleanType, valueContainsNull = true))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, Map("a" -> null, "b" -> true, "c" -> false))
}
{
@@ -695,7 +695,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
StructField("b", IntegerType, nullable = true),
StructField("c", IntegerType, nullable = true),
StructField("d", IntegerType, nullable = true))))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, InternalRow(123, null, null, null))
}
{
@@ -712,7 +712,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
StructField("b", BooleanType, nullable = true),
StructField("c", BooleanType, nullable = true),
StructField("d", BooleanType, nullable = true))))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, InternalRow(null, true, false, null))
}
{
@@ -729,7 +729,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
StructField("a", IntegerType, nullable = true),
StructField("b", IntegerType, nullable = true),
StructField("c", IntegerType, nullable = true))))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, InternalRow(123, null, null))
}
{
@@ -744,7 +744,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
StructField("a", BooleanType, nullable = true),
StructField("b", BooleanType, nullable = true),
StructField("c", BooleanType, nullable = true))))
- assert(ret.resolved === true)
+ assert(ret.resolved)
checkEvaluation(ret, InternalRow(null, true, false))
}
{
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala
index bed8547..910e6c8 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionExpressionsSuite.scala
@@ -1137,9 +1137,9 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
checkEvaluation(Concat(Seq(aa0, aa1)), Seq(Seq("a", "b"), Seq("c"), Seq("d"), Seq("e", "f")))
assert(Concat(Seq(ai0, ai1)).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(Concat(Seq(ai0, ai2)).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(Concat(Seq(ai0, ai2)).dataType.asInstanceOf[ArrayType].containsNull)
assert(Concat(Seq(as0, as1)).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(Concat(Seq(as0, as2)).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(Concat(Seq(as0, as2)).dataType.asInstanceOf[ArrayType].containsNull)
assert(Concat(Seq(aa0, aa1)).dataType ===
ArrayType(ArrayType(StringType, containsNull = false), containsNull = false))
assert(Concat(Seq(aa0, aa2)).dataType ===
@@ -1450,9 +1450,9 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
Seq[Seq[Int]](Seq[Int](1, 2), Seq[Int](3, 4), Seq[Int](5, 6), Seq[Int](2, 1)))
assert(ArrayUnion(a00, a01).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayUnion(a00, a02).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayUnion(a00, a02).dataType.asInstanceOf[ArrayType].containsNull)
assert(ArrayUnion(a20, a21).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayUnion(a20, a22).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayUnion(a20, a22).dataType.asInstanceOf[ArrayType].containsNull)
}
test("Shuffle") {
@@ -1631,10 +1631,10 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
checkEvaluation(ArrayExcept(aa1, aa0), Seq[Seq[Int]](Seq[Int](2, 1)))
assert(ArrayExcept(a00, a01).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayExcept(a04, a02).dataType.asInstanceOf[ArrayType].containsNull === true)
- assert(ArrayExcept(a04, a05).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayExcept(a04, a02).dataType.asInstanceOf[ArrayType].containsNull)
+ assert(ArrayExcept(a04, a05).dataType.asInstanceOf[ArrayType].containsNull)
assert(ArrayExcept(a20, a21).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayExcept(a24, a22).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayExcept(a24, a22).dataType.asInstanceOf[ArrayType].containsNull)
}
test("Array Except - null handling") {
@@ -1757,9 +1757,9 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper
assert(ArrayIntersect(a00, a01).dataType.asInstanceOf[ArrayType].containsNull === false)
assert(ArrayIntersect(a00, a04).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayIntersect(a04, a05).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayIntersect(a04, a05).dataType.asInstanceOf[ArrayType].containsNull)
assert(ArrayIntersect(a20, a21).dataType.asInstanceOf[ArrayType].containsNull === false)
- assert(ArrayIntersect(a23, a24).dataType.asInstanceOf[ArrayType].containsNull === true)
+ assert(ArrayIntersect(a23, a24).dataType.asInstanceOf[ArrayType].containsNull)
}
test("Array Intersect - null handling") {
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ComplexTypeSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ComplexTypeSuite.scala
index d65b49f..67f748c 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ComplexTypeSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ComplexTypeSuite.scala
@@ -154,9 +154,9 @@ class ComplexTypeSuite extends SparkFunSuite with ExpressionEvalHelper {
val nullStruct_fieldNotNullable = Literal.create(null, typeS_fieldNotNullable)
assert(getStructField(struct_fieldNotNullable, "a").nullable === false)
- assert(getStructField(struct, "a").nullable === true)
- assert(getStructField(nullStruct_fieldNotNullable, "a").nullable === true)
- assert(getStructField(nullStruct, "a").nullable === true)
+ assert(getStructField(struct, "a").nullable)
+ assert(getStructField(nullStruct_fieldNotNullable, "a").nullable)
+ assert(getStructField(nullStruct, "a").nullable)
}
test("GetArrayStructFields") {
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConditionalExpressionSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConditionalExpressionSuite.scala
index f489d33..5721165 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConditionalExpressionSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ConditionalExpressionSuite.scala
@@ -90,27 +90,27 @@ class ConditionalExpressionSuite extends SparkFunSuite with ExpressionEvalHelper
checkEvaluation(CaseWhen(Seq((c1, c4), (c2, c5)), c6), "c", row)
checkEvaluation(CaseWhen(Seq((c1, c4), (c2, c5))), null, row)
- assert(CaseWhen(Seq((c2, c4)), c6).nullable === true)
- assert(CaseWhen(Seq((c2, c4), (c3, c5)), c6).nullable === true)
- assert(CaseWhen(Seq((c2, c4), (c3, c5))).nullable === true)
+ assert(CaseWhen(Seq((c2, c4)), c6).nullable)
+ assert(CaseWhen(Seq((c2, c4), (c3, c5)), c6).nullable)
+ assert(CaseWhen(Seq((c2, c4), (c3, c5))).nullable)
val c4_notNull = 'a.boolean.notNull.at(3)
val c5_notNull = 'a.boolean.notNull.at(4)
val c6_notNull = 'a.boolean.notNull.at(5)
assert(CaseWhen(Seq((c2, c4_notNull)), c6_notNull).nullable === false)
- assert(CaseWhen(Seq((c2, c4)), c6_notNull).nullable === true)
- assert(CaseWhen(Seq((c2, c4_notNull))).nullable === true)
- assert(CaseWhen(Seq((c2, c4_notNull)), c6).nullable === true)
+ assert(CaseWhen(Seq((c2, c4)), c6_notNull).nullable)
+ assert(CaseWhen(Seq((c2, c4_notNull))).nullable)
+ assert(CaseWhen(Seq((c2, c4_notNull)), c6).nullable)
assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull)), c6_notNull).nullable === false)
- assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull)), c6_notNull).nullable === true)
- assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5)), c6_notNull).nullable === true)
- assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull)), c6).nullable === true)
+ assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull)), c6_notNull).nullable)
+ assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5)), c6_notNull).nullable)
+ assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull)), c6).nullable)
- assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull))).nullable === true)
- assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull))).nullable === true)
- assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5))).nullable === true)
+ assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5_notNull))).nullable)
+ assert(CaseWhen(Seq((c2, c4), (c3, c5_notNull))).nullable)
+ assert(CaseWhen(Seq((c2, c4_notNull), (c3, c5))).nullable)
}
test("if/case when - null flags of non-primitive types") {
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
index 8bec32d..62d194f 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
@@ -181,7 +181,7 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
test("Seconds") {
assert(Second(Literal.create(null, DateType), gmtId).resolved === false)
- assert(Second(Cast(Literal(d), TimestampType, gmtId), gmtId).resolved === true)
+ assert(Second(Cast(Literal(d), TimestampType, gmtId), gmtId).resolved )
checkEvaluation(Second(Cast(Literal(d), TimestampType, gmtId), gmtId), 0)
checkEvaluation(Second(Cast(Literal(date), TimestampType, gmtId), gmtId), 15)
checkEvaluation(Second(Literal(ts), gmtId), 15)
@@ -268,7 +268,7 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
test("Hour") {
assert(Hour(Literal.create(null, DateType), gmtId).resolved === false)
- assert(Hour(Literal(ts), gmtId).resolved === true)
+ assert(Hour(Literal(ts), gmtId).resolved)
checkEvaluation(Hour(Cast(Literal(d), TimestampType, gmtId), gmtId), 0)
checkEvaluation(Hour(Cast(Literal(date), TimestampType, gmtId), gmtId), 13)
checkEvaluation(Hour(Literal(ts), gmtId), 13)
@@ -294,7 +294,7 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
test("Minute") {
assert(Minute(Literal.create(null, DateType), gmtId).resolved === false)
- assert(Minute(Literal(ts), gmtId).resolved === true)
+ assert(Minute(Literal(ts), gmtId).resolved)
checkEvaluation(Minute(Cast(Literal(d), TimestampType, gmtId), gmtId), 0)
checkEvaluation(
Minute(Cast(Literal(date), TimestampType, gmtId), gmtId), 10)
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala
index e95f2df..1e7737b 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala
@@ -231,15 +231,14 @@ class StringExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
val s_notNull = 'a.string.notNull.at(0)
- assert(Substring(s, Literal.create(0, IntegerType), Literal.create(2, IntegerType)).nullable
- === true)
+ assert(Substring(s, Literal.create(0, IntegerType), Literal.create(2, IntegerType)).nullable)
assert(
Substring(s_notNull, Literal.create(0, IntegerType), Literal.create(2, IntegerType)).nullable
=== false)
assert(Substring(s_notNull,
- Literal.create(null, IntegerType), Literal.create(2, IntegerType)).nullable === true)
+ Literal.create(null, IntegerType), Literal.create(2, IntegerType)).nullable)
assert(Substring(s_notNull,
- Literal.create(0, IntegerType), Literal.create(null, IntegerType)).nullable === true)
+ Literal.create(0, IntegerType), Literal.create(null, IntegerType)).nullable)
checkEvaluation(s.substr(0, 2), "ex", row)
checkEvaluation(s.substr(0), "example", row)
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodegenExpressionCachingSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodegenExpressionCachingSuite.scala
index fe5cb8e..ee0167b 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodegenExpressionCachingSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodegenExpressionCachingSuite.scala
@@ -58,7 +58,7 @@ class CodegenExpressionCachingSuite extends SparkFunSuite {
expr2.mutableState = true
val instance2 = UnsafeProjection.create(Seq(expr2))
assert(instance1.apply(null).getBoolean(0) === false)
- assert(instance2.apply(null).getBoolean(0) === true)
+ assert(instance2.apply(null).getBoolean(0))
}
test("GenerateMutableProjection should not share expression instances") {
@@ -70,7 +70,7 @@ class CodegenExpressionCachingSuite extends SparkFunSuite {
expr2.mutableState = true
val instance2 = GenerateMutableProjection.generate(Seq(expr2))
assert(instance1.apply(null).getBoolean(0) === false)
- assert(instance2.apply(null).getBoolean(0) === true)
+ assert(instance2.apply(null).getBoolean(0))
}
test("GeneratePredicate should not share expression instances") {
@@ -82,7 +82,7 @@ class CodegenExpressionCachingSuite extends SparkFunSuite {
expr2.mutableState = true
val instance2 = GeneratePredicate.generate(expr2)
assert(instance1.eval(null) === false)
- assert(instance2.eval(null) === true)
+ assert(instance2.eval(null))
}
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/xml/UDFXPathUtilSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/xml/UDFXPathUtilSuite.scala
index 0fec15b..8de972f 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/xml/UDFXPathUtilSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/xml/UDFXPathUtilSuite.scala
@@ -57,7 +57,7 @@ class UDFXPathUtilSuite extends SparkFunSuite {
test("boolean eval") {
var ret =
util.evalBoolean("<a><b>true</b><b>false</b><b>b3</b><c>c1</c><c>c2</c></a>", "a/b[1]/text()")
- assert(ret == true)
+ assert(ret)
ret = util.evalBoolean("<a><b>true</b><b>false</b><b>b3</b><c>c1</c><c>c2</c></a>", "a/b[4]")
assert(ret == false)
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala
index aaab3ff..8445239 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala
@@ -69,10 +69,10 @@ class LogicalPlanSuite extends SparkFunSuite {
}
require(relation.isStreaming === false)
- require(incrementalRelation.isStreaming === true)
+ require(incrementalRelation.isStreaming)
assert(TestBinaryRelation(relation, relation).isStreaming === false)
- assert(TestBinaryRelation(incrementalRelation, relation).isStreaming === true)
- assert(TestBinaryRelation(relation, incrementalRelation).isStreaming === true)
+ assert(TestBinaryRelation(incrementalRelation, relation).isStreaming)
+ assert(TestBinaryRelation(relation, incrementalRelation).isStreaming)
assert(TestBinaryRelation(incrementalRelation, incrementalRelation).isStreaming)
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/MetadataSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/MetadataSuite.scala
index a0c1d97..a16fcfc 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/MetadataSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/MetadataSuite.scala
@@ -59,29 +59,29 @@ class MetadataSuite extends SparkFunSuite {
test("metadata builder and getters") {
assert(age.contains("summary") === false)
- assert(age.contains("index") === true)
+ assert(age.contains("index"))
assert(age.getLong("index") === 1L)
- assert(age.contains("average") === true)
+ assert(age.contains("average"))
assert(age.getDouble("average") === 45.0)
- assert(age.contains("categorical") === true)
+ assert(age.contains("categorical"))
assert(age.getBoolean("categorical") === false)
- assert(age.contains("name") === true)
+ assert(age.contains("name"))
assert(age.getString("name") === "age")
- assert(metadata.contains("purpose") === true)
+ assert(metadata.contains("purpose"))
assert(metadata.getString("purpose") === "ml")
- assert(metadata.contains("isBase") === true)
+ assert(metadata.contains("isBase"))
assert(metadata.getBoolean("isBase") === false)
- assert(metadata.contains("summary") === true)
+ assert(metadata.contains("summary"))
assert(metadata.getMetadata("summary") === summary)
- assert(metadata.contains("long[]") === true)
+ assert(metadata.contains("long[]"))
assert(metadata.getLongArray("long[]").toSeq === Seq(0L, 1L))
- assert(metadata.contains("double[]") === true)
+ assert(metadata.contains("double[]"))
assert(metadata.getDoubleArray("double[]").toSeq === Seq(3.0, 4.0))
- assert(metadata.contains("boolean[]") === true)
+ assert(metadata.contains("boolean[]"))
assert(metadata.getBooleanArray("boolean[]").toSeq === Seq(true, false))
- assert(gender.contains("categories") === true)
+ assert(gender.contains("categories"))
assert(gender.getStringArray("categories").toSeq === Seq("male", "female"))
- assert(metadata.contains("features") === true)
+ assert(metadata.contains("features"))
assert(metadata.getMetadataArray("features").toSeq === Seq(age, gender))
}
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala
index d92f52f..87d1cd4 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala
@@ -373,7 +373,7 @@ class DataTypeWriteCompatibilitySuite extends SparkFunSuite {
def assertAllowed(writeType: DataType, readType: DataType, name: String, desc: String): Unit = {
assert(
DataType.canWrite(writeType, readType, analysis.caseSensitiveResolution, name,
- errMsg => fail(s"Should not produce errors but was called with: $errMsg")) === true, desc)
+ errMsg => fail(s"Should not produce errors but was called with: $errMsg")), desc)
}
def assertSingleError(
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/MetadataSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/MetadataSuite.scala
index b4aeac5..c3ae798e 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/MetadataSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/MetadataSuite.scala
@@ -57,7 +57,7 @@ class MetadataSuite extends SparkFunSuite {
val meta = new MetadataBuilder().putBoolean("key", true).build()
assert(meta === meta)
assert(meta.## !== 0)
- assert(meta.getBoolean("key") === true)
+ assert(meta.getBoolean("key"))
assert(meta.contains("key"))
assert(meta === Metadata.fromJson(meta.json))
intercept[NoSuchElementException](meta.getBoolean("no_such_key"))
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala
index 92a2480..6ee54b9 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala
@@ -629,7 +629,7 @@ private[state] class HDFSBackedStateStoreProvider extends StateStoreProvider wit
require(allFiles.exists(_.version == version))
val latestSnapshotFileBeforeVersion = allFiles
- .filter(_.isSnapshot == true)
+ .filter(_.isSnapshot)
.takeWhile(_.version <= version)
.lastOption
val deltaBatchFiles = latestSnapshotFileBeforeVersion match {
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala
index 97c3f35..e581211 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala
@@ -394,9 +394,9 @@ class DatasetAggregatorSuite extends QueryTest with SharedSQLContext {
val ds1 = Seq(1, 3, 2, 5).toDS()
assert(ds1.select(typed.sum((i: Int) => i)).schema.head.nullable === false)
val ds2 = Seq(AggData(1, "a"), AggData(2, "a")).toDS()
- assert(ds2.select(SeqAgg.toColumn).schema.head.nullable === true)
+ assert(ds2.select(SeqAgg.toColumn).schema.head.nullable)
val ds3 = sql("SELECT 'Some String' AS b, 1279869254 AS a").as[AggData]
- assert(ds3.select(NameAgg.toColumn).schema.head.nullable === true)
+ assert(ds3.select(NameAgg.toColumn).schema.head.nullable)
}
test("SPARK-18147: very complex aggregator result type") {
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
index a4ca9e6..4eef115 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
@@ -1209,14 +1209,14 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
val df1 = Seq(1, 2, 3, 4).toDF
assert(df1.schema(0).nullable == false)
val df2 = Seq(Integer.valueOf(1), Integer.valueOf(2)).toDF
- assert(df2.schema(0).nullable == true)
+ assert(df2.schema(0).nullable)
val df3 = Seq(Seq(1, 2), Seq(3, 4)).toDF
- assert(df3.schema(0).nullable == true)
+ assert(df3.schema(0).nullable)
assert(df3.schema(0).dataType.asInstanceOf[ArrayType].containsNull == false)
val df4 = Seq(Seq("a", "b"), Seq("c", "d")).toDF
- assert(df4.schema(0).nullable == true)
- assert(df4.schema(0).dataType.asInstanceOf[ArrayType].containsNull == true)
+ assert(df4.schema(0).nullable)
+ assert(df4.schema(0).dataType.asInstanceOf[ArrayType].containsNull)
val df5 = Seq((0, 1.0), (2, 2.0)).toDF("id", "v")
assert(df5.schema(0).nullable == false)
@@ -1224,32 +1224,32 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
val df6 = Seq((0, 1.0, "a"), (2, 2.0, "b")).toDF("id", "v1", "v2")
assert(df6.schema(0).nullable == false)
assert(df6.schema(1).nullable == false)
- assert(df6.schema(2).nullable == true)
+ assert(df6.schema(2).nullable)
val df7 = (Tuple1(Array(1, 2, 3)) :: Nil).toDF("a")
- assert(df7.schema(0).nullable == true)
+ assert(df7.schema(0).nullable)
assert(df7.schema(0).dataType.asInstanceOf[ArrayType].containsNull == false)
val df8 = (Tuple1(Array((null: Integer), (null: Integer))) :: Nil).toDF("a")
- assert(df8.schema(0).nullable == true)
- assert(df8.schema(0).dataType.asInstanceOf[ArrayType].containsNull == true)
+ assert(df8.schema(0).nullable)
+ assert(df8.schema(0).dataType.asInstanceOf[ArrayType].containsNull)
val df9 = (Tuple1(Map(2 -> 3)) :: Nil).toDF("m")
- assert(df9.schema(0).nullable == true)
+ assert(df9.schema(0).nullable)
assert(df9.schema(0).dataType.asInstanceOf[MapType].valueContainsNull == false)
val df10 = (Tuple1(Map(1 -> (null: Integer))) :: Nil).toDF("m")
- assert(df10.schema(0).nullable == true)
- assert(df10.schema(0).dataType.asInstanceOf[MapType].valueContainsNull == true)
+ assert(df10.schema(0).nullable)
+ assert(df10.schema(0).dataType.asInstanceOf[MapType].valueContainsNull)
val df11 = Seq(TestDataPoint(1, 2.2, "a", null),
TestDataPoint(3, 4.4, "null", (TestDataPoint2(33, "b")))).toDF
assert(df11.schema(0).nullable == false)
assert(df11.schema(1).nullable == false)
- assert(df11.schema(2).nullable == true)
- assert(df11.schema(3).nullable == true)
+ assert(df11.schema(2).nullable)
+ assert(df11.schema(3).nullable)
assert(df11.schema(3).dataType.asInstanceOf[StructType].fields(0).nullable == false)
- assert(df11.schema(3).dataType.asInstanceOf[StructType].fields(1).nullable == true)
+ assert(df11.schema(3).dataType.asInstanceOf[StructType].fields(1).nullable)
}
Seq(true, false).foreach { eager =>
@@ -1517,7 +1517,7 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
val ds1 = spark.emptyDataset[Int]
val ds2 = Seq(1, 2, 3).toDS()
- assert(ds1.isEmpty == true)
+ assert(ds1.isEmpty)
assert(ds2.isEmpty == false)
}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala
index 142ab61..71bd096 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala
@@ -293,7 +293,7 @@ class PlannerSuite extends SharedSQLContext {
case Repartition (numPartitions, shuffle, Repartition(_, shuffleChild, _)) =>
assert(numPartitions === 5)
assert(shuffle === false)
- assert(shuffleChild === true)
+ assert(shuffleChild)
}
}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/ProcessingTimeExecutorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/ProcessingTimeExecutorSuite.scala
index 2d338ab..723764c 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/ProcessingTimeExecutorSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/ProcessingTimeExecutorSuite.scala
@@ -146,7 +146,7 @@ class ProcessingTimeExecutorSuite extends SparkFunSuite with TimeLimits {
eventually { assert(clock.isStreamWaitingFor(200)) }
clock.advance(200)
waitForThreadJoin(t)
- assert(batchFallingBehindCalled === true)
+ assert(batchFallingBehindCalled)
}
private def eventually(body: => Unit): Unit = {
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala
index 9a7595e..3dd3210 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala
@@ -42,7 +42,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext {
coordinatorRef.reportActiveInstance(id, "hostX", "exec1")
eventually(timeout(5 seconds)) {
- assert(coordinatorRef.verifyIfInstanceActive(id, "exec1") === true)
+ assert(coordinatorRef.verifyIfInstanceActive(id, "exec1"))
assert(
coordinatorRef.getLocation(id) ===
Some(ExecutorCacheTaskLocation("hostX", "exec1").toString))
@@ -52,7 +52,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext {
eventually(timeout(5 seconds)) {
assert(coordinatorRef.verifyIfInstanceActive(id, "exec1") === false)
- assert(coordinatorRef.verifyIfInstanceActive(id, "exec2") === true)
+ assert(coordinatorRef.verifyIfInstanceActive(id, "exec2"))
assert(
coordinatorRef.getLocation(id) ===
@@ -76,15 +76,15 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext {
coordinatorRef.reportActiveInstance(id3, host, exec)
eventually(timeout(5 seconds)) {
- assert(coordinatorRef.verifyIfInstanceActive(id1, exec) === true)
- assert(coordinatorRef.verifyIfInstanceActive(id2, exec) === true)
- assert(coordinatorRef.verifyIfInstanceActive(id3, exec) === true)
+ assert(coordinatorRef.verifyIfInstanceActive(id1, exec))
+ assert(coordinatorRef.verifyIfInstanceActive(id2, exec))
+ assert(coordinatorRef.verifyIfInstanceActive(id3, exec))
}
coordinatorRef.deactivateInstances(runId1)
assert(coordinatorRef.verifyIfInstanceActive(id1, exec) === false)
- assert(coordinatorRef.verifyIfInstanceActive(id2, exec) === true)
+ assert(coordinatorRef.verifyIfInstanceActive(id2, exec))
assert(coordinatorRef.verifyIfInstanceActive(id3, exec) === false)
assert(coordinatorRef.getLocation(id1) === None)
@@ -108,7 +108,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext {
coordRef1.reportActiveInstance(id, "hostX", "exec1")
eventually(timeout(5 seconds)) {
- assert(coordRef2.verifyIfInstanceActive(id, "exec1") === true)
+ assert(coordRef2.verifyIfInstanceActive(id, "exec1"))
assert(
coordRef2.getLocation(id) ===
Some(ExecutorCacheTaskLocation("hostX", "exec1").toString))
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala
index c2e783d..247efd5 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnVectorSuite.scala
@@ -298,7 +298,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getBoolean(i) == (i % 2 == 0))
@@ -322,7 +322,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getByte(i) == i)
@@ -346,7 +346,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getShort(i) == i)
@@ -370,7 +370,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getInt(i) == i)
@@ -394,7 +394,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getLong(i) == i.toLong)
@@ -418,7 +418,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getFloat(i) == i.toFloat)
@@ -442,7 +442,7 @@ class ColumnVectorSuite extends SparkFunSuite with BeforeAndAfterEach {
val columnAccessor = ColumnAccessor(dataType, columnBuilder.build)
ColumnAccessor.decompress(columnAccessor, testVector, 16)
- assert(testVector.isNullAt(0) == true)
+ assert(testVector.isNullAt(0))
for (i <- 1 until 16) {
assert(testVector.isNullAt(i) == false)
assert(testVector.getDouble(i) == i.toDouble)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala
index e8062db..cbfd9d9 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala
@@ -988,14 +988,14 @@ class ColumnarBatchSuite extends SparkFunSuite {
// Verify the results of the row.
assert(batch.numCols() == 4)
assert(batch.numRows() == 1)
- assert(batch.rowIterator().hasNext == true)
- assert(batch.rowIterator().hasNext == true)
+ assert(batch.rowIterator().hasNext)
+ assert(batch.rowIterator().hasNext)
assert(columns(0).getInt(0) == 1)
assert(columns(0).isNullAt(0) == false)
assert(columns(1).getDouble(0) == 1.1)
assert(columns(1).isNullAt(0) == false)
- assert(columns(2).isNullAt(0) == true)
+ assert(columns(2).isNullAt(0))
assert(columns(3).getUTF8String(0).toString == "Hello")
// Verify the iterator works correctly.
@@ -1006,7 +1006,7 @@ class ColumnarBatchSuite extends SparkFunSuite {
assert(row.isNullAt(0) == false)
assert(row.getDouble(1) == 1.1)
assert(row.isNullAt(1) == false)
- assert(row.isNullAt(2) == true)
+ assert(row.isNullAt(2))
assert(columns(3).getUTF8String(0).toString == "Hello")
assert(it.hasNext == false)
assert(it.hasNext == false)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfEntrySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfEntrySuite.scala
index 135370b..71e0d86 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfEntrySuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfEntrySuite.scala
@@ -71,15 +71,15 @@ class SQLConfEntrySuite extends SparkFunSuite {
assert(conf.getConf(confEntry, false) === false)
conf.setConf(confEntry, true)
- assert(conf.getConf(confEntry, false) === true)
+ assert(conf.getConf(confEntry, false))
conf.setConfString(key, "true")
assert(conf.getConfString(key, "false") === "true")
assert(conf.getConfString(key) === "true")
- assert(conf.getConf(confEntry, false) === true)
+ assert(conf.getConf(confEntry, false))
conf.setConfString(key, " true ")
- assert(conf.getConf(confEntry, false) === true)
+ assert(conf.getConf(confEntry, false))
val e = intercept[IllegalArgumentException] {
conf.setConfString(key, "abc")
}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala
index c9a6975..62cf705 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala
@@ -118,12 +118,12 @@ class SQLConfSuite extends QueryTest with SharedSQLContext {
spark.sessionState.conf.clear()
val original = spark.conf.get(SQLConf.GROUP_BY_ORDINAL)
try {
- assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL) === true)
+ assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL))
sql(s"set ${SQLConf.GROUP_BY_ORDINAL.key}=false")
assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL) === false)
assert(sql(s"set").where(s"key = '${SQLConf.GROUP_BY_ORDINAL.key}'").count() == 1)
sql(s"reset")
- assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL) === true)
+ assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL))
assert(sql(s"set").where(s"key = '${SQLConf.GROUP_BY_ORDINAL.key}'").count() == 0)
} finally {
sql(s"set ${SQLConf.GROUP_BY_ORDINAL}=$original")
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala
index 43463a8..df7e921 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala
@@ -267,7 +267,7 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
val state2 = GroupStateImpl.createForStreaming(
initState, 1000, 1000, timeoutConf, hasTimedOut = true, watermarkPresent = false)
- assert(state2.hasTimedOut === true)
+ assert(state2.hasTimedOut)
}
// for batch queries
@@ -1162,7 +1162,7 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
test(s"InputProcessor - process timed out state - $testName") {
val mapGroupsFunc = (key: Int, values: Iterator[Int], state: GroupState[Int]) => {
- assert(state.hasTimedOut === true, "hasTimedOut not true")
+ assert(state.hasTimedOut, "hasTimedOut not true")
assert(values.isEmpty, "values not empty")
stateUpdates(state)
Iterator.empty
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala
index d00f2e3..10b2966 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala
@@ -215,14 +215,14 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter {
val listener2 = new EventCollector
spark.streams.addListener(listener1)
- assert(isListenerActive(listener1) === true)
+ assert(isListenerActive(listener1))
assert(isListenerActive(listener2) === false)
spark.streams.addListener(listener2)
- assert(isListenerActive(listener1) === true)
- assert(isListenerActive(listener2) === true)
+ assert(isListenerActive(listener1))
+ assert(isListenerActive(listener2))
spark.streams.removeListener(listener1)
assert(isListenerActive(listener1) === false)
- assert(isListenerActive(listener2) === true)
+ assert(isListenerActive(listener2))
} finally {
addedListeners().foreach(spark.streams.removeListener)
}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala
index 729173c..97a6ba8 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala
@@ -134,7 +134,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
val mapped = inputData.toDS().map { 6 / _}
testStream(mapped)(
- AssertOnQuery(_.isActive === true),
+ AssertOnQuery(_.isActive),
AssertOnQuery(_.exception.isEmpty),
AddData(inputData, 1, 2),
CheckAnswer(6, 3),
@@ -148,7 +148,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
TestAwaitTermination(ExpectNotBlocked, timeoutMs = 2000, expectedReturnValue = true),
TestAwaitTermination(ExpectNotBlocked, timeoutMs = 10, expectedReturnValue = true),
StartStream(),
- AssertOnQuery(_.isActive === true),
+ AssertOnQuery(_.isActive),
AddData(inputData, 0),
ExpectFailure[SparkException](),
AssertOnQuery(_.isActive === false),
@@ -170,7 +170,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
val mapped = inputData.toDS().map { 6 / _}
testStream(mapped)(
- AssertOnQuery(_.isActive === true),
+ AssertOnQuery(_.isActive),
StopStream,
AddData(inputData, 1, 2),
StartStream(trigger = Once),
@@ -272,7 +272,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
AdvanceManualClock(1000), // time = 1000 to start new trigger, will block on `latestOffset`
AssertStreamExecThreadIsWaitingForTime(1050),
AssertOnQuery(_.status.isDataAvailable === false),
- AssertOnQuery(_.status.isTriggerActive === true),
+ AssertOnQuery(_.status.isTriggerActive),
AssertOnQuery(_.status.message.startsWith("Getting offsets from")),
AssertOnQuery(_.recentProgress.count(_.numInputRows > 0) === 0),
@@ -280,16 +280,16 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
AssertClockTime(1050),
// will block on `planInputPartitions` that needs 1350
AssertStreamExecThreadIsWaitingForTime(1150),
- AssertOnQuery(_.status.isDataAvailable === true),
- AssertOnQuery(_.status.isTriggerActive === true),
+ AssertOnQuery(_.status.isDataAvailable),
+ AssertOnQuery(_.status.isTriggerActive),
AssertOnQuery(_.status.message === "Processing new data"),
AssertOnQuery(_.recentProgress.count(_.numInputRows > 0) === 0),
AdvanceManualClock(100), // time = 1150 to unblock `planInputPartitions`
AssertClockTime(1150),
AssertStreamExecThreadIsWaitingForTime(1500), // will block on map task that needs 1500
- AssertOnQuery(_.status.isDataAvailable === true),
- AssertOnQuery(_.status.isTriggerActive === true),
+ AssertOnQuery(_.status.isDataAvailable),
+ AssertOnQuery(_.status.isTriggerActive),
AssertOnQuery(_.status.message === "Processing new data"),
AssertOnQuery(_.recentProgress.count(_.numInputRows > 0) === 0),
@@ -298,7 +298,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
AssertClockTime(1500),
CheckAnswer(2),
AssertStreamExecThreadIsWaitingForTime(2000), // will block until the next trigger
- AssertOnQuery(_.status.isDataAvailable === true),
+ AssertOnQuery(_.status.isDataAvailable),
AssertOnQuery(_.status.isTriggerActive === false),
AssertOnQuery(_.status.message === "Waiting for next trigger"),
AssertOnQuery { query =>
@@ -341,7 +341,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
AssertClockTime(2000),
AssertStreamExecThreadIsWaitingForTime(3000), // will block waiting for next trigger time
CheckAnswer(4),
- AssertOnQuery(_.status.isDataAvailable === true),
+ AssertOnQuery(_.status.isDataAvailable),
AssertOnQuery(_.status.isTriggerActive === false),
AssertOnQuery(_.status.message === "Waiting for next trigger"),
AssertOnQuery { query =>
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala
index c841793..97b694e 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala
@@ -307,7 +307,7 @@ class StreamingDataSourceV2Suite extends StreamTest {
eventually(timeout(streamingTimeout)) {
// Write options should not be set.
assert(LastWriteOptions.options.getBoolean(readOptionName, false) == false)
- assert(LastReadOptions.options.getBoolean(readOptionName, false) == true)
+ assert(LastReadOptions.options.getBoolean(readOptionName, false))
}
}
}
@@ -318,7 +318,7 @@ class StreamingDataSourceV2Suite extends StreamTest {
eventually(timeout(streamingTimeout)) {
// Read options should not be set.
assert(LastReadOptions.options.getBoolean(writeOptionName, false) == false)
- assert(LastWriteOptions.options.getBoolean(writeOptionName, false) == true)
+ assert(LastWriteOptions.options.getBoolean(writeOptionName, false))
}
}
}
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala
index b323871..bdbcfe9 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala
@@ -183,7 +183,7 @@ class VersionsSuite extends SparkFunSuite with Logging {
}
test(s"$version: databaseExists") {
- assert(client.databaseExists("default") == true)
+ assert(client.databaseExists("default"))
assert(client.databaseExists("nonexist") == false)
}
@@ -198,7 +198,7 @@ class VersionsSuite extends SparkFunSuite with Logging {
}
test(s"$version: dropDatabase") {
- assert(client.databaseExists("temporary") == true)
+ assert(client.databaseExists("temporary"))
client.dropDatabase("temporary", ignoreIfNotExists = false, cascade = true)
assert(client.databaseExists("temporary") == false)
}
@@ -492,7 +492,7 @@ class VersionsSuite extends SparkFunSuite with Logging {
// Hive 0.12 doesn't allow customized permanent functions
assert(client.functionExists("default", "func1") == false)
} else {
- assert(client.functionExists("default", "func1") == true)
+ assert(client.functionExists("default", "func1"))
}
}
@@ -504,7 +504,7 @@ class VersionsSuite extends SparkFunSuite with Logging {
}
} else {
client.renameFunction("default", "func1", "func2")
- assert(client.functionExists("default", "func2") == true)
+ assert(client.functionExists("default", "func2"))
}
}
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala
index 2332ee2..19da181 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/CheckpointSuite.scala
@@ -912,8 +912,8 @@ class CheckpointSuite extends TestSuiteBase with DStreamCheckpointTester
}
ssc.start()
batchCounter.waitUntilBatchesCompleted(1, 10000)
- assert(shouldCheckpointAllMarkedRDDs === true)
- assert(rddsCheckpointed === true)
+ assert(shouldCheckpointAllMarkedRDDs)
+ assert(rddsCheckpointed)
}
/**
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StateMapSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StateMapSuite.scala
index e444132..d0c56ec 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/StateMapSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/StateMapSuite.scala
@@ -165,7 +165,7 @@ class StateMapSuite extends SparkFunSuite {
map = map.copy().asInstanceOf[OpenHashMapBasedStateMap[Int, Int]]
}
assert(map.deltaChainLength > deltaChainThreshold)
- assert(map.shouldCompact === true)
+ assert(map.shouldCompact)
val deser_map = testSerialization(map, "Deserialized + compacted map not same as original map")
assert(deser_map.deltaChainLength < deltaChainThreshold)
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
index 52c8959..8d07210 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
@@ -212,7 +212,7 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with TimeL
ssc.sc.setLocalProperty("customPropKey", "value2")
eventually(timeout(10 seconds), interval(10 milliseconds)) {
- assert(allFound === true)
+ assert(allFound)
}
// Verify streaming jobs have expected thread-local properties
@@ -493,7 +493,7 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with TimeL
}
}
t.start()
- assert(ssc.awaitTerminationOrTimeout(10000) === true)
+ assert(ssc.awaitTerminationOrTimeout(10000))
}
// SparkContext.stop will set SparkEnv.env to null. We need to make sure SparkContext is stopped
// before running the next test. Otherwise, it's possible that we set SparkEnv.env to null after
@@ -605,7 +605,7 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with TimeL
sc = new SparkContext(conf)
ssc = StreamingContext.getActiveOrCreate(creatingFunc _)
assert(ssc != null, "no context created")
- assert(newContextCreated === true, "new context not created")
+ assert(newContextCreated, "new context not created")
assert(StreamingContext.getActive().isEmpty,
"new initialized context returned before starting")
ssc.start()
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala
index 9b6bc71..58ce3a9 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala
@@ -117,7 +117,7 @@ class MapWithStateRDDSuite extends SparkFunSuite with RDDCheckpointTester with B
state.remove()
None
case None =>
- assert(state.isTimingOut() === true, "State is not timing out when data = None")
+ assert(state.isTimingOut(), "State is not timing out when data = None")
timingOutStates += state.get()
None
case _ =>
@@ -153,9 +153,9 @@ class MapWithStateRDDSuite extends SparkFunSuite with RDDCheckpointTester with B
// Data present, function should be called irrespective of whether state exists
assertRecordUpdate(initStates = Seq(0), data = Seq("noop"),
expectedStates = Seq((0, initialTime)))
- assert(functionCalled === true)
+ assert(functionCalled)
assertRecordUpdate(initStates = None, data = Some("noop"), expectedStates = None)
- assert(functionCalled === true)
+ assert(functionCalled)
// Function called with right state data
assertRecordUpdate(initStates = None, data = Seq("get-state"),
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala
index 580f831..7b839ae 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala
@@ -66,7 +66,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
// Verify start marks the generator active, but does not call the callbacks
blockGenerator.start()
- assert(blockGenerator.isActive() === true, "block generator active after start()")
+ assert(blockGenerator.isActive(), "block generator active after start()")
assert(blockGenerator.isStopped() === false, "block generator stopped after start()")
withClue("callbacks called before adding data") {
assert(listener.onAddDataCalled === false)
@@ -85,8 +85,8 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
clock.advance(blockIntervalMs) // advance clock to generate blocks
withClue("blocks not generated or pushed") {
eventually(timeout(1 second)) {
- assert(listener.onGenerateBlockCalled === true)
- assert(listener.onPushBlockCalled === true)
+ assert(listener.onGenerateBlockCalled)
+ assert(listener.onPushBlockCalled)
}
}
listener.pushedData.asScala.toSeq should contain theSameElementsInOrderAs (data1)
@@ -96,7 +96,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
val data2 = 11 to 20
val metadata2 = data2.map { _.toString }
data2.zip(metadata2).foreach { case (d, m) => blockGenerator.addDataWithCallback(d, m) }
- assert(listener.onAddDataCalled === true)
+ assert(listener.onAddDataCalled)
listener.addedData.asScala.toSeq should contain theSameElementsInOrderAs (data2)
listener.addedMetadata.asScala.toSeq should contain theSameElementsInOrderAs (metadata2)
clock.advance(blockIntervalMs) // advance clock to generate blocks
@@ -122,7 +122,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
val thread = stopBlockGenerator(blockGenerator)
eventually(timeout(1 second), interval(10 milliseconds)) {
clock.advance(blockIntervalMs)
- assert(blockGenerator.isStopped() === true)
+ assert(blockGenerator.isStopped())
}
thread.join()
@@ -148,7 +148,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
blockGenerator = new BlockGenerator(listener, 0, conf, clock)
require(listener.onGenerateBlockCalled === false)
blockGenerator.start()
- assert(blockGenerator.isActive() === true, "block generator")
+ assert(blockGenerator.isActive(), "block generator")
assert(blockGenerator.isStopped() === false)
val data = 1 to 1000
@@ -198,7 +198,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
clock.advance(blockIntervalMs)
assert(thread.isAlive === false)
}
- assert(blockGenerator.isStopped() === true) // generator has finally been completely stopped
+ assert(blockGenerator.isStopped()) // generator has finally been completely stopped
assert(listener.pushedData.asScala.toSeq === data, "All data not pushed by stop()")
}
@@ -214,7 +214,7 @@ class BlockGeneratorSuite extends SparkFunSuite with BeforeAndAfter with TimeLim
assert(listener.onErrorCalled === false)
blockGenerator.addData(1)
eventually(timeout(1 second), interval(10 milliseconds)) {
- assert(listener.onErrorCalled === true)
+ assert(listener.onErrorCalled)
}
blockGenerator.stop()
}
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala
index 4707d6e..fcbba00 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala
@@ -335,7 +335,7 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite
.set("spark.streaming.dynamicAllocation.enabled", "true")
.set(DYN_ALLOCATION_ENABLED, true)
.set(DYN_ALLOCATION_TESTING, true)
- require(Utils.isDynamicAllocationEnabled(confWithBothDynamicAllocationEnabled) === true)
+ require(Utils.isDynamicAllocationEnabled(confWithBothDynamicAllocationEnabled))
withStreamingContext(confWithBothDynamicAllocationEnabled) { ssc =>
intercept[IllegalArgumentException] {
ssc.start()
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala
index c20380d..dc9305c 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala
@@ -83,7 +83,7 @@ abstract class CommonWriteAheadLogTests(
val logDirectoryPath = new Path(testDir)
val fileSystem = HdfsUtils.getFileSystemForPath(logDirectoryPath, hadoopConf)
- assert(fileSystem.exists(logDirectoryPath) === true)
+ assert(fileSystem.exists(logDirectoryPath))
// Read data using manager and verify
val readData = readDataUsingWriteAheadLog(testDir, closeFileAfterWrite, allowBatching)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org