Skip to content
Snippets Groups Projects
Commit 8be198c8 authored by Reynold Xin's avatar Reynold Xin
Browse files

Two minor comments from code review on 191bf268.

parent 191bf268
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ object GenerateUnsafeRowJoiner extends CodeGenerator[(StructType, StructType), U
} else if (i - bitset1Words < bitset2Words - 1) {
// combine next two words of bitset2
s"($getLong(obj2, offset2 + ${(i - bitset1Words) * 8}) >>> (64 - $bitset1Remainder))" +
s"| ($getLong(obj2, offset2 + ${(i - bitset1Words + 1) * 8}) << $bitset1Remainder)"
s" | ($getLong(obj2, offset2 + ${(i - bitset1Words + 1) * 8}) << $bitset1Remainder)"
} else {
// last word of bitset2
s"$getLong(obj2, offset2 + ${(i - bitset1Words) * 8}) >>> (64 - $bitset1Remainder)"
......
......@@ -92,6 +92,8 @@ class GenerateUnsafeRowJoinerBitsetSuite extends SparkFunSuite {
private def createUnsafeRow(numFields: Int): UnsafeRow = {
val row = new UnsafeRow
val sizeInBytes = numFields * 8 + ((numFields + 63) / 64) * 8
// Allocate a larger buffer than needed and point the UnsafeRow to somewhere in the middle.
// This way we can test the joiner when the input UnsafeRows are not the entire arrays.
val offset = numFields * 8
val buf = new Array[Byte](sizeInBytes + offset)
row.pointTo(buf, PlatformDependent.BYTE_ARRAY_OFFSET + offset, numFields, sizeInBytes)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment