Skip to content
Closed
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 @@ -149,15 +149,15 @@ public void testSetLastSetUsage() throws Exception {
dataVector.setSafe(0, 1, 10);
dataVector.setSafe(1, 1, 11);
dataVector.setSafe(2, 1, 12);
offsetBuffer.setInt((index + 1) * LargeListVector.OFFSET_WIDTH, 3);
offsetBuffer.setLong((index + 1) * LargeListVector.OFFSET_WIDTH, 3);

index += 1;

/* write [13, 14] to the list vector at index 1 */
BitVectorHelper.setBit(validityBuffer, index);
dataVector.setSafe(3, 1, 13);
dataVector.setSafe(4, 1, 14);
offsetBuffer.setInt((index + 1) * LargeListVector.OFFSET_WIDTH, 5);
offsetBuffer.setLong((index + 1) * LargeListVector.OFFSET_WIDTH, 5);

index += 1;

Expand All @@ -166,7 +166,7 @@ public void testSetLastSetUsage() throws Exception {
dataVector.setSafe(5, 1, 15);
dataVector.setSafe(6, 1, 16);
dataVector.setSafe(7, 1, 17);
offsetBuffer.setInt((index + 1) * LargeListVector.OFFSET_WIDTH, 8);
offsetBuffer.setLong((index + 1) * LargeListVector.OFFSET_WIDTH, 8);

/* check current lastSet */
assertEquals(-1L, listVector.getLastSet());
Expand Down Expand Up @@ -217,7 +217,7 @@ public void testSetLastSetUsage() throws Exception {
assertEquals(0.8D, listVector.getDensity(), 0);

index = 0;
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(0), Integer.toString(offset));

Object actual = dataVector.getObject(offset);
Expand All @@ -230,7 +230,7 @@ public void testSetLastSetUsage() throws Exception {
assertEquals(new Long(12), (Long) actual);

index++;
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(3), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -240,7 +240,7 @@ public void testSetLastSetUsage() throws Exception {
assertEquals(new Long(14), (Long) actual);

index++;
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(5), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -253,7 +253,7 @@ public void testSetLastSetUsage() throws Exception {
assertEquals(new Long(17), (Long) actual);

index++;
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(8), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand Down Expand Up @@ -327,7 +327,7 @@ public void testSplitAndTransfer() throws Exception {

/* index 0 */
assertFalse(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(0), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -342,7 +342,7 @@ public void testSplitAndTransfer() throws Exception {
/* index 1 */
index++;
assertFalse(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(3), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -354,7 +354,7 @@ public void testSplitAndTransfer() throws Exception {
/* index 2 */
index++;
assertFalse(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(5), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -372,7 +372,7 @@ public void testSplitAndTransfer() throws Exception {
/* index 3 */
index++;
assertFalse(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(9), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -381,7 +381,7 @@ public void testSplitAndTransfer() throws Exception {
/* index 4 */
index++;
assertFalse(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(10), Integer.toString(offset));

actual = dataVector.getObject(offset);
Expand All @@ -399,7 +399,7 @@ public void testSplitAndTransfer() throws Exception {
/* index 5 */
index++;
assertTrue(listVector.isNull(index));
offset = offsetBuffer.getInt(index * LargeListVector.OFFSET_WIDTH);
offset = (int) offsetBuffer.getLong(index * LargeListVector.OFFSET_WIDTH);
assertEquals(Integer.toString(14), Integer.toString(offset));

/* do split and transfer */
Expand Down Expand Up @@ -428,16 +428,16 @@ public void testSplitAndTransfer() throws Exception {
BigIntVector dataVector1 = (BigIntVector) toVector.getDataVector();

for (int i = 0; i < splitLength; i++) {
dataLength1 = offsetBuffer.getInt((start + i + 1) * LargeListVector.OFFSET_WIDTH) -
offsetBuffer.getInt((start + i) * LargeListVector.OFFSET_WIDTH);
dataLength2 = toOffsetBuffer.getInt((i + 1) * LargeListVector.OFFSET_WIDTH) -
toOffsetBuffer.getInt(i * LargeListVector.OFFSET_WIDTH);
dataLength1 = (int) offsetBuffer.getLong((start + i + 1) * LargeListVector.OFFSET_WIDTH) -
(int) offsetBuffer.getLong((start + i) * LargeListVector.OFFSET_WIDTH);
dataLength2 = (int) toOffsetBuffer.getLong((i + 1) * LargeListVector.OFFSET_WIDTH) -
(int) toOffsetBuffer.getLong(i * LargeListVector.OFFSET_WIDTH);

assertEquals("Different data lengths at index: " + i + " and start: " + start,
dataLength1, dataLength2);

offset1 = offsetBuffer.getInt((start + i) * LargeListVector.OFFSET_WIDTH);
offset2 = toOffsetBuffer.getInt(i * LargeListVector.OFFSET_WIDTH);
offset1 = (int) offsetBuffer.getLong((start + i) * LargeListVector.OFFSET_WIDTH);
offset2 = (int) toOffsetBuffer.getLong(i * LargeListVector.OFFSET_WIDTH);

for (int j = 0; j < dataLength1; j++) {
assertEquals("Different data at indexes: " + offset1 + " and " + offset2,
Expand Down Expand Up @@ -560,9 +560,9 @@ public void testNestedLargeListVector() throws Exception {
final ArrowBuf offsetBuffer = listVector.getOffsetBuffer();

/* listVector has 2 lists at index 0 and 3 lists at index 1 */
assertEquals(0, offsetBuffer.getInt(0 * LargeListVector.OFFSET_WIDTH));
assertEquals(2, offsetBuffer.getInt(1 * LargeListVector.OFFSET_WIDTH));
assertEquals(5, offsetBuffer.getInt(2 * LargeListVector.OFFSET_WIDTH));
assertEquals(0, offsetBuffer.getLong(0 * LargeListVector.OFFSET_WIDTH));
assertEquals(2, offsetBuffer.getLong(1 * LargeListVector.OFFSET_WIDTH));
assertEquals(5, offsetBuffer.getLong(2 * LargeListVector.OFFSET_WIDTH));
}
}

Expand Down Expand Up @@ -688,9 +688,9 @@ public void testNestedLargeListVector2() throws Exception {
final ArrowBuf offsetBuffer = listVector.getOffsetBuffer();

/* listVector has 2 lists at index 0 and 3 lists at index 1 */
assertEquals(0, offsetBuffer.getInt(0 * LargeListVector.OFFSET_WIDTH));
assertEquals(2, offsetBuffer.getInt(1 * LargeListVector.OFFSET_WIDTH));
assertEquals(4, offsetBuffer.getInt(2 * LargeListVector.OFFSET_WIDTH));
assertEquals(0, offsetBuffer.getLong(0 * LargeListVector.OFFSET_WIDTH));
assertEquals(2, offsetBuffer.getLong(1 * LargeListVector.OFFSET_WIDTH));
assertEquals(4, offsetBuffer.getLong(2 * LargeListVector.OFFSET_WIDTH));
}
}

Expand Down