Skip to content

Commit

Permalink
Fix a potential NPE error in the sized hash join (#12101)
Browse files Browse the repository at this point in the history
This PR fixes a potential NPE error in the sized hash join by checking the buffer's existence before actually closing it.
Otherwise duplicate call to this close method will lead to a NPE error.

It is a quite simple change so no tests for it.
  • Loading branch information
firestarman authored Feb 13, 2025
1 parent bffd13c commit 4a4f713
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1105,7 +1105,7 @@ sealed trait SpillableHostConcatResult extends AutoCloseable {
SpillableHostBuffer(hmb, hmb.getLength, SpillPriorities.ACTIVE_BATCHING_PRIORITY)
}

override def close(): Unit = {
override def close(): Unit = if (buffer != null) {
buffer.close()
buffer = null
}
Expand Down

0 comments on commit 4a4f713

Please sign in to comment.