[GitHub] spark pull request #17464: [SPARK-20134][SQL] SQLMetrics.postDriverMetricUpd...

2017-03-29 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/17464


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #17464: [SPARK-20134][SQL] SQLMetrics.postDriverMetricUpd...

2017-03-29 Thread rxin
Github user rxin commented on a diff in the pull request:

https://github.com/apache/spark/pull/17464#discussion_r108600240
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala
 ---
@@ -477,9 +477,11 @@ private case class MyPlan(sc: SparkContext, 
expectedValue: Long) extends LeafExe
 
   override def doExecute(): RDD[InternalRow] = {
 longMetric("dummy") += expectedValue
-sc.listenerBus.post(SparkListenerDriverAccumUpdates(
-  sc.getLocalProperty(SQLExecution.EXECUTION_ID_KEY).toLong,
-  metrics.values.map(m => m.id -> m.value).toSeq))
+
+SQLMetrics.postDriverMetricUpdates(
+  sparkContext,
+  sc.getLocalProperty(SQLExecution.EXECUTION_ID_KEY),
--- End diff --

hm for some reason both works. i agree it'd be better to be the same.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #17464: [SPARK-20134][SQL] SQLMetrics.postDriverMetricUpd...

2017-03-29 Thread ueshin
Github user ueshin commented on a diff in the pull request:

https://github.com/apache/spark/pull/17464#discussion_r108596378
  
--- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala
 ---
@@ -477,9 +477,11 @@ private case class MyPlan(sc: SparkContext, 
expectedValue: Long) extends LeafExe
 
   override def doExecute(): RDD[InternalRow] = {
 longMetric("dummy") += expectedValue
-sc.listenerBus.post(SparkListenerDriverAccumUpdates(
-  sc.getLocalProperty(SQLExecution.EXECUTION_ID_KEY).toLong,
-  metrics.values.map(m => m.id -> m.value).toSeq))
+
+SQLMetrics.postDriverMetricUpdates(
+  sparkContext,
+  sc.getLocalProperty(SQLExecution.EXECUTION_ID_KEY),
--- End diff --

Should these be used the same variable name, `sparkContext` or `sc`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #17464: [SPARK-20134][SQL] SQLMetrics.postDriverMetricUpd...

2017-03-28 Thread rxin
GitHub user rxin opened a pull request:

https://github.com/apache/spark/pull/17464

[SPARK-20134][SQL] SQLMetrics.postDriverMetricUpdates to simplify driver 
side metric updates

## What changes were proposed in this pull request?
It is not super intuitive how to update SQLMetric on the driver side. This 
patch introduces a new SQLMetrics.postDriverMetricUpdates function to do that, 
and adds documentation to make it more obvious.

## How was this patch tested?
Updated a test case to use this method.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/rxin/spark SPARK-20134

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/17464.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #17464


commit 360e9d71b1865443fe45920cd938fe8e8d1354e3
Author: Reynold Xin 
Date:   2017-03-29T04:54:12Z

[SPARK-20134][SQL] SQLMetrics.postDriverMetricUpdates to simplify driver 
side metric updates




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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