spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hvanhovell <...@git.apache.org>
Subject [GitHub] spark pull request #21634: [SPARK-24648][SQL] SqlMetrics should be threadsaf...
Date Mon, 25 Jun 2018 15:35:02 GMT
Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21634#discussion_r197841906
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
---
    @@ -504,4 +504,38 @@ class SQLMetricsSuite extends SparkFunSuite with SQLMetricsTestUtils
with Shared
       test("writing data out metrics with dynamic partition: parquet") {
         testMetricsDynamicPartition("parquet", "parquet", "t1")
       }
    +
    +  test("writing metrics from single thread") {
    +    val nAdds = 10
    +    val acc = new SQLMetric("test", -10)
    +    assert(acc.isZero())
    +    acc.set(0)
    +    for (i <- 1 to nAdds) acc.add(1)
    +    assert(!acc.isZero())
    +    assert(nAdds === acc.value)
    +    acc.reset()
    +    assert(acc.isZero())
    +  }
    +
    +  test("writing metrics from multiple threads") {
    --- End diff --
    
    Thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message