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 @@ -70,12 +70,17 @@ public ConstantColumnVector(int numRows, DataType type) {

@Override
public void close() {
stringData = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not related to the NPE fix, but it's good to have. We should release the memory for UTF8String as well.

byteArrayData = null;
for (int i = 0; i < childData.length; i++) {
childData[i].close();
childData[i] = null;
if (childData != null) {
for (int i = 0; i < childData.length; i++) {
if (childData[i] != null) {
childData[i].close();
childData[i] = null;
}
}
childData = null;
}
childData = null;
arrayData = null;
mapData = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class ConstantColumnVectorSuite extends SparkFunSuite {
private def testVector(name: String, size: Int, dt: DataType)
(f: ConstantColumnVector => Unit): Unit = {
test(name) {
f(new ConstantColumnVector(size, dt))
val vector = new ConstantColumnVector(size, dt)
f(vector)
vector.close()
}
}

Expand Down