Skip to content

Commit

Permalink
Fix ORC reader issue with bystream reader (#7988)
Browse files Browse the repository at this point in the history
Resolves issue with ORC reader.

There were two issues,

There was a missing check to keep number of streams that needs to be accessed.
The position which was being used to calculate buffer length was wrong, and assigned non-zero value for a stream whose length is zero.

Authors:
  - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu)

Approvers:
  - Ayush Dattagupta (https://github.com/ayushdg)
  - Paul Taylor (https://github.com/trxcllnt)
  - Devavret Makkar (https://github.com/devavret)

URL: #7988
  • Loading branch information
rgsl888prabhu authored Apr 19, 2021
1 parent 05330dd commit b8baed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/src/io/orc/stripe_data.cu
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ static __device__ void bytestream_init(volatile orc_bytestream_s *bs,
const uint8_t *base,
uint32_t len)
{
uint32_t pos = static_cast<uint32_t>(7 & reinterpret_cast<size_t>(base));
uint32_t pos = (len > 0) ? static_cast<uint32_t>(7 & reinterpret_cast<size_t>(base)) : 0;
bs->base = base - pos;
bs->pos = (len > 0) ? pos : 0;
bs->pos = pos;
bs->len = (len + pos + 7) & ~7;
bs->fill_pos = 0;
bs->fill_count = min(bs->len, bytestream_buffer_size) >> 3;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/io/orc/stripe_init.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern "C" __global__ void __launch_bounds__(128, 8) gpuParseCompressedStripeDat
int strm_id = blockIdx.x * 4 + (threadIdx.x / 32);
int lane_id = threadIdx.x % 32;

if (lane_id == 0) { s->info = strm_info[strm_id]; }
if (strm_id < num_streams && lane_id == 0) { s->info = strm_info[strm_id]; }

__syncthreads();
if (strm_id < num_streams) {
Expand Down

0 comments on commit b8baed5

Please sign in to comment.