Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ private MapIterator(int numRecords, Location loc, boolean destructive) {
this.destructive = destructive;
if (destructive) {
destructiveIterator = this;
// longArray will not be used anymore if destructive is true, release it now.
if (longArray != null) {
freeArray(longArray);
longArray = null;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ class UnsafeFixedWidthAggregationMapSuite
PAGE_SIZE_BYTES
)
val groupKey = InternalRow(UTF8String.fromString("cats"))
val row = map.getAggregationBuffer(groupKey)

// Looking up a key stores a zero-entry in the map (like Python Counters or DefaultDicts)
assert(map.getAggregationBuffer(groupKey) != null)
assert(row != null)
val iter = map.iterator()
assert(iter.next())
iter.getKey.getString(0) should be ("cats")
Expand All @@ -138,7 +139,7 @@ class UnsafeFixedWidthAggregationMapSuite

// Modifications to rows retrieved from the map should update the values in the map
iter.getValue.setInt(0, 42)
map.getAggregationBuffer(groupKey).getInt(0) should be (42)
row.getInt(0) should be (42)

map.free()
}
Expand Down