srowen commented on a change in pull request #35989:
URL: https://github.com/apache/spark/pull/35989#discussion_r836441535
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SubqueryBroadcastExec.scala
##########
@@ -89,10 +90,15 @@ case class SubqueryBroadcastExec(
val proj = UnsafeProjection.create(expr)
val keyIter = iter.map(proj).map(_.copy())
- val rows = keyIter.toArray[InternalRow].distinct
+ val rows = if (broadcastRelation.keyIsUnique) {
+ keyIter.toArray[InternalRow]
+ } else {
+ keyIter.toArray[InternalRow].distinct
+ }
val beforeBuild = System.nanoTime()
longMetric("collectTime") += (beforeBuild - beforeCollect) / 1000000
val dataSize = rows.map(_.asInstanceOf[UnsafeRow].getSizeInBytes).sum
+ longMetric("numOutputRows") += rows.length
Review comment:
Out of curiosity, why does this metric also have to be added / updated?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]