Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] ORC writer: fix incorrect ByteRLE encoding of literal_run=128 #3267

Merged
merged 3 commits into from
Nov 1, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
- PR #3256 Fix orc writer crash with multiple string columns
- PR #3211 Fix breaking change caused by rapidsai/rmm#167
- PR #3265 Fix dangling pointer in `is_sorted`
- PR #3267 ORC writer: fix incorrect ByteRLE encoding of long literal runs

# cuDF 0.10.0 (16 Oct 2019)

Expand Down
7 changes: 3 additions & 4 deletions cpp/src/io/orc/stripe_enc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static __device__ uint32_t ByteRLE(orcenc_state_s *s, const uint8_t *inbuf, uint
if (t < literal_run)
{
uint32_t run_id = t >> 7;
uint32_t run = (run_id == num_runs - 1) ? literal_run & 0x7f : 0x80;
uint32_t run = min(literal_run - run_id * 128, 128);
if (!(t & 0x7f))
dst[run_id + t] = 0x100 - run;
dst[run_id + t + 1] = (cid == CI_PRESENT) ? __brev(v0) >> 24 : v0;
Expand All @@ -254,11 +254,10 @@ static __device__ uint32_t ByteRLE(orcenc_state_s *s, const uint8_t *inbuf, uint
inpos += 130;
repeat_run -= 130;
}
if (!flush)
if (!flush && repeat_run == numvals)
{
// Wait for more data in case we can continue the run later
if (repeat_run == numvals && !flush)
break;
break;
}
if (repeat_run >= 3)
{
Expand Down