Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/21968#discussion_r212909243
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
---
@@ -164,9 +164,8 @@ private[joins] class UnsafeHashedRelation(
def getValue(key: InternalRow): InternalRow = {
val unsafeKey = key.asInstanceOf[UnsafeRow]
val map = binaryMap // avoid the compiler error
- val loc = new map.Location // this could be allocated in stack
- binaryMap.safeLookup(unsafeKey.getBaseObject, unsafeKey.getBaseOffset,
- unsafeKey.getSizeInBytes, loc, unsafeKey.hashCode())
+ val loc = map.lookup(unsafeKey.getBaseObject, unsafeKey.getBaseOffset,
--- End diff --
Before this PR, `loc` is allocated at each call of `getValue()`. After this
PR, `loc` will be shared within each `binaryMap` that is passed to a
constructor of `UnsafeHashedRelation`.
Is this behavior change safe?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]