Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgerrets committed Jul 12, 2023
1 parent e74e76a commit f16c1a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/storage/compression/bitpacking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ struct BitpackingState {
delta_buffer[0] = minimum_delta;

can_do_delta = can_do_delta && TrySubtractOperator::Operation(maximum_delta, minimum_delta, min_max_delta_diff);
can_do_delta =
can_do_delta && TrySubtractOperator::Operation(static_cast<T_S>(compression_buffer[0]), minimum_delta, delta_offset);
can_do_delta = can_do_delta && TrySubtractOperator::Operation(static_cast<T_S>(compression_buffer[0]),
minimum_delta, delta_offset);
}

template <class T_INNER>
Expand Down Expand Up @@ -862,8 +862,8 @@ void BitpackingFetchRow(ColumnSegment &segment, ColumnFetchState &state, row_t r

if (scan_state.current_group.mode == BitpackingMode::CONSTANT_DELTA) {
// FIXME: is it being verified that this will never overflow?
*current_result_ptr =
(static_cast<T>(scan_state.current_group_offset) * scan_state.current_constant) + scan_state.current_frame_of_reference;
*current_result_ptr = (static_cast<T>(scan_state.current_group_offset) * scan_state.current_constant) +
scan_state.current_frame_of_reference;
return;
}

Expand Down
7 changes: 4 additions & 3 deletions src/storage/compression/bitpacking_hugeint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ static void PackSingle(const hugeint_t in, uint32_t *__restrict &out, uint16_t d
}
}


static void PackLast(const hugeint_t *__restrict in, uint32_t *__restrict out, uint16_t delta) {
const uint8_t LAST_IDX = 31;
const uint16_t SHIFT = (delta * 31) % 32;
Expand Down Expand Up @@ -265,7 +264,8 @@ void HugeIntPacker::Pack(const hugeint_t *__restrict in, uint32_t *__restrict ou
break;
default:
for (idx_t oindex = 0; oindex < BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE - 1; ++oindex) {
PackSingle(in[oindex], out, width, (width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE, (hugeint_t(1) << width) - 1);
PackSingle(in[oindex], out, width, (width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE,
(hugeint_t(1) << width) - 1);
}
PackLast(in, out, width);
}
Expand All @@ -292,7 +292,8 @@ void HugeIntPacker::Unpack(const uint32_t *__restrict in, hugeint_t *__restrict
break;
default:
for (idx_t oindex = 0; oindex < BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE - 1; ++oindex) {
UnpackSingle(in, out + oindex, width, (width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE);
UnpackSingle(in, out + oindex, width,
(width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE);
}
UnpackLast(in, out, width);
}
Expand Down

0 comments on commit f16c1a8

Please sign in to comment.