This is an automated email from the ASF dual-hosted git repository.
wenchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new e0d81d9 [SPARK-35791][SQL] Release on-going map properly for
NULL-aware ANTI join
e0d81d9 is described below
commit e0d81d9b712310dd1d70988299b6fba4777945a1
Author: Cheng Su <[email protected]>
AuthorDate: Thu Jun 17 13:57:35 2021 +0800
[SPARK-35791][SQL] Release on-going map properly for NULL-aware ANTI join
### What changes were proposed in this pull request?
NULL-aware ANTI join (https://issues.apache.org/jira/browse/SPARK-32290)
detects NULL join keys during building the map for `HashedRelation`, and will
immediately return `HashedRelationWithAllNullKeys` without taking care of the
map built already. Before returning `HashedRelationWithAllNullKeys`, the map
needs to be freed properly to save memory and keep memory accounting correctly.
### Why are the changes needed?
Save memory and keep memory accounting correctly for the join query.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing unit tests introduced in
https://github.com/apache/spark/pull/29104 .
Closes #32939 from c21/free-null-aware.
Authored-by: Cheng Su <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
---
.../scala/org/apache/spark/sql/execution/joins/HashedRelation.scala | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
b/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
index 225cff8..80f2143 100644
---
a/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
+++
b/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
@@ -479,6 +479,7 @@ private[joins] object UnsafeHashedRelation {
throw
QueryExecutionErrors.cannotAcquireMemoryToBuildUnsafeHashedRelationError()
}
} else if (isNullAware) {
+ binaryMap.free()
return HashedRelationWithAllNullKeys
}
}
@@ -1060,6 +1061,7 @@ private[joins] object LongHashedRelation {
val key = rowKey.getLong(0)
map.append(key, unsafeRow)
} else if (isNullAware) {
+ map.free()
return HashedRelationWithAllNullKeys
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]