-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20872][SQL] ShuffleExchange.nodeName should handle null coordinator #18095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| override lazy val metrics = Map( | ||
| "dataSize" -> SQLMetrics.createSizeMetric(sparkContext, "data size")) | ||
|
|
||
| override def nodeName: String = { | ||
| val extraInfo = coordinator match { | ||
| case Some(exchangeCoordinator) => | ||
| s"(coordinator id: ${System.identityHashCode(exchangeCoordinator)})" | ||
| case None => "" | ||
| case _ => "" | ||
|
||
| } | ||
|
|
||
| val simpleNodeName = "Exchange" | ||
|
|
@@ -70,7 +73,7 @@ case class ShuffleExchange( | |
| // the plan. | ||
| coordinator match { | ||
| case Some(exchangeCoordinator) => exchangeCoordinator.registerExchange(this) | ||
| case None => | ||
| case _ => | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -117,7 +120,7 @@ case class ShuffleExchange( | |
| val shuffleRDD = exchangeCoordinator.postShuffleRDD(this) | ||
| assert(shuffleRDD.partitions.length == newPartitioning.numPartitions) | ||
| shuffleRDD | ||
| case None => | ||
| case _ => | ||
| val shuffleDependency = prepareShuffleDependency() | ||
| preparePostShuffleRDD(shuffleDependency) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove this empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.