aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavies Liu <davies@databricks.com>2016-09-19 11:49:03 -0700
committerDavies Liu <davies.liu@gmail.com>2016-09-19 11:49:03 -0700
commite0632062635c37cbc77df7ebd2a1846655193e12 (patch)
tree2b1663a6908dbed38cf55465b19f4e38259ef0b5
parent80d6655921bea9b1bb27c1d95c2b46654e7a8cca (diff)
downloadspark-e0632062635c37cbc77df7ebd2a1846655193e12.tar.gz
spark-e0632062635c37cbc77df7ebd2a1846655193e12.tar.bz2
spark-e0632062635c37cbc77df7ebd2a1846655193e12.zip
[SPARK-16439] [SQL] bring back the separator in SQL UI
## What changes were proposed in this pull request? Currently, the SQL metrics looks like `number of rows: 111111111111`, it's very hard to read how large the number is. So a separator was added by #12425, but removed by #14142, because the separator is weird in some locales (for example, pl_PL), this PR will add that back, but always use "," as the separator, since the SQL UI are all in English. ## How was this patch tested? Existing tests. ![metrics](https://cloud.githubusercontent.com/assets/40902/14573908/21ad2f00-030d-11e6-9e2c-c544f30039ea.png) Author: Davies Liu <davies@databricks.com> Closes #15106 from davies/metric_sep.
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
index 15afa0b1a5..0cc1edd196 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
@@ -18,6 +18,7 @@
package org.apache.spark.sql.execution.metric
import java.text.NumberFormat
+import java.util.Locale
import org.apache.spark.SparkContext
import org.apache.spark.scheduler.AccumulableInfo
@@ -101,8 +102,7 @@ object SQLMetrics {
*/
def stringValue(metricsType: String, values: Seq[Long]): String = {
if (metricsType == SUM_METRIC) {
- val numberFormat = NumberFormat.getInstance()
- numberFormat.setGroupingUsed(false)
+ val numberFormat = NumberFormat.getIntegerInstance(Locale.ENGLISH)
numberFormat.format(values.sum)
} else {
val strFormat: Long => String = if (metricsType == SIZE_METRIC) {