Skip to content

HashedRelation

HashedRelation is an extension of the KnownSizeEstimation abstraction for relations with values hashed by some key.

sealed trait

HashedRelation is a Scala sealed trait which means that all possible implementations (HashedRelations) are all in the same compilation unit (file).

Contract

asReadOnlyCopy

asReadOnlyCopy(): HashedRelation

A read-only copy of this HashedRelation to be safely used in a separate thread

Used when BroadcastHashJoinExec physical operator is executed

close

close(): Unit

Used when ShuffledHashJoinExec physical operator is requested to buildHashedRelation

get

get(
  key: InternalRow): Iterator[InternalRow]
get(
  key: Long): Iterator[InternalRow]

Gets internal rows for the given key or null

Used when:

getValue

getValue(
  key: InternalRow): InternalRow
getValue(
  key: Long): InternalRow

Gives the value internal row for the given key

Used when LongHashedRelation is requested to get a value for a key

keyIsUnique

keyIsUnique: Boolean

Used when BroadcastHashJoinExec physical operator is requested to multipleOutputForOneInput, codegenInner, codegenOuter, codegenSemi, codegenAnti, codegenExistence

keys

keys(): Iterator[InternalRow]

Used when SubqueryBroadcastExec physical operator is requested for relationFuture

Implementations

Creating HashedRelation

apply(
  input: Iterator[InternalRow],
  key: Seq[Expression],
  sizeEstimate: Int = 64,
  taskMemoryManager: TaskMemoryManager = null): HashedRelation

apply creates a LongHashedRelation when the input key collection has a single expression of type long or a UnsafeHashedRelation otherwise.

Note

The input key expressions are:

apply is used when:


Last update: 2020-10-21