[GitHub] spark pull request #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread asfgit
Github user asfgit closed the pull request at:

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


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread jiangxb1987
Github user jiangxb1987 commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118384528
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -40,14 +40,17 @@ case class ShuffleExchange(
 child: SparkPlan,
 @transient coordinator: Option[ExchangeCoordinator]) extends Exchange {
 
+  // NOTE: coordinator can be null after serialization/deserialization,
+  //   e.g. it can be null on the Executor side
+
--- End diff --

Sounds good to me.


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread rednaxelafx
Github user rednaxelafx commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118382726
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -40,14 +40,17 @@ case class ShuffleExchange(
 child: SparkPlan,
 @transient coordinator: Option[ExchangeCoordinator]) extends Exchange {
 
+  // NOTE: coordinator can be null after serialization/deserialization,
+  //   e.g. it can be null on the Executor side
+
--- End diff --

This note is meant to be a class internal comment, and not a comment on 
`override lazy val metrics = Map(`, so I'd say leaving the added empty line 
here makes more sense. Would you agree?


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread jiangxb1987
Github user jiangxb1987 commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118365866
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -40,14 +40,17 @@ case class ShuffleExchange(
 child: SparkPlan,
 @transient coordinator: Option[ExchangeCoordinator]) extends Exchange {
 
+  // NOTE: coordinator can be null after serialization/deserialization,
+  //   e.g. it can be null on the Executor side
+
--- End diff --

nit: remove this empty line.


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread jiangxb1987
Github user jiangxb1987 commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118361491
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -47,7 +47,7 @@ case class ShuffleExchange(
 val extraInfo = coordinator match {
   case Some(exchangeCoordinator) =>
 s"(coordinator id: 
${System.identityHashCode(exchangeCoordinator)})"
-  case None => ""
+  case _ => ""
--- End diff --

Let's do it then, that will enable future readers easier to understand the 
code.


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread rednaxelafx
Github user rednaxelafx commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118359189
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -47,7 +47,7 @@ case class ShuffleExchange(
 val extraInfo = coordinator match {
   case Some(exchangeCoordinator) =>
 s"(coordinator id: 
${System.identityHashCode(exchangeCoordinator)})"
-  case None => ""
+  case _ => ""
--- End diff --

I had left the other match conditions unchanged so that this change itself 
can be small and contained, because I'd need to verify whether or not the other 
match conditions should only be invoked with some valid 
`Option[ExchangeCoordinator]` value.

Anyway, I checked the two other `coordinator match { ... }` cases below, 
and both of them should still work fine to change to match on `_` instead of 
`None`. But semantically both of these cases should only be invoked on the 
Driver side, where the `coordinator` shouldn't be `null`. I'm okay to change 
these two cases if reviewers suggest so.


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread sameeragarwal
Github user sameeragarwal commented on a diff in the pull request:

https://github.com/apache/spark/pull/18095#discussion_r118339002
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/ShuffleExchange.scala
 ---
@@ -47,7 +47,7 @@ case class ShuffleExchange(
 val extraInfo = coordinator match {
   case Some(exchangeCoordinator) =>
 s"(coordinator id: 
${System.identityHashCode(exchangeCoordinator)})"
-  case None => ""
+  case _ => ""
--- End diff --

should we adjust this pattern match condition at other places in the class 
below as well?


---
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 #18095: [SPARK-20872][SQL] ShuffleExchange.nodeName shoul...

2017-05-24 Thread rednaxelafx
GitHub user rednaxelafx opened a pull request:

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

[SPARK-20872][SQL] ShuffleExchange.nodeName should handle null coordinator

## What changes were proposed in this pull request?

A one-liner change in `ShuffleExchange.nodeName` to cover the case when 
`coordinator` is `null`, so that the match expression is exhaustive.

Please refer to 
[SPARK-20872](https://issues.apache.org/jira/browse/SPARK-20872) for a 
description of the symptoms.

## How was this patch tested?

Manually tested this change with a case where the `coordinator` is null to 
make sure `ShuffleExchange.nodeName` doesn't throw a `MatchError` any more.


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

$ git pull https://github.com/rednaxelafx/apache-spark 
shuffleexchange-nodename

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

https://github.com/apache/spark/pull/18095.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 #18095


commit 23aff2a468b9b1522f6520489bdca2ee7389a10a
Author: Kris Mok 
Date:   2017-05-24T18:44:43Z

SPARK-20872: make ShuffleExchange.nodeName handle null coordinator




---
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