Skip to content
Merged
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
6 changes: 3 additions & 3 deletions cpp/src/arrow/array/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void FillZeroLengthArray(const DataType* type, ArraySpan* span) {
span->length = 0;
int num_buffers = GetNumBuffers(*type);
for (int i = 0; i < num_buffers; ++i) {
span->buffers[i].data = span->scratch_space;
span->buffers[i].data = reinterpret_cast<uint8_t*>(span->scratch_space);
span->buffers[i].size = 0;
}

Expand Down Expand Up @@ -270,7 +270,7 @@ void ArraySpan::FillFromScalar(const Scalar& value) {
}
} else if (is_base_binary_like(type_id)) {
const auto& scalar = checked_cast<const BaseBinaryScalar&>(value);
this->buffers[1].data = this->scratch_space;
this->buffers[1].data = reinterpret_cast<uint8_t*>(this->scratch_space);
const uint8_t* data_buffer = nullptr;
int64_t data_size = 0;
if (scalar.is_valid) {
Expand Down Expand Up @@ -328,7 +328,7 @@ void ArraySpan::FillFromScalar(const Scalar& value) {
// First buffer is kept null since unions have no validity vector
this->buffers[0] = {};

this->buffers[1].data = this->scratch_space;
this->buffers[1].data = reinterpret_cast<uint8_t*>(this->scratch_space);
this->buffers[1].size = 1;
int8_t* type_codes = reinterpret_cast<int8_t*>(this->scratch_space);
type_codes[0] = checked_cast<const UnionScalar&>(value).type_code;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/array/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct ARROW_EXPORT ArraySpan {
// 16 bytes of scratch space to enable this ArraySpan to be a view onto
// scalar values including binary scalars (where we need to create a buffer
// that looks like two 32-bit or 64-bit offsets)
alignas(64) uint8_t scratch_space[16];
uint64_t scratch_space[2];

ArraySpan() = default;

Expand Down
4 changes: 4 additions & 0 deletions cpp/src/arrow/compute/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ int64_t ExecSpanIterator::GetNextChunkSpan(int64_t iteration_size, ExecSpan* spa
continue;
}
const ChunkedArray* arg = args_->at(i).chunked_array().get();
if (arg->num_chunks() == 0) {
iteration_size = 0;
continue;
}
const Array* current_chunk;
while (true) {
current_chunk = arg->chunk(chunk_indexes_[i]).get();
Expand Down