Tim Armstrong has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/2780

Change subject: IMPALA-3317: fix crash in sorter when spilling zero-length 
strings
......................................................................

IMPALA-3317: fix crash in sorter when spilling zero-length strings

The sorter converts string pointers to block offsets when spilling.
There was a subtle bug in the logic that assumed if the offset was
past the end of the current block, the data must necessarily be in
the next block. This is not true for zero-length strings, because
there is no backing storage so the pointer can point to the byte
after the end of the block.

This patch fixes the bug by using a simpler offset encoding scheme
that packs the block number into the upper 32 bits and the offset
within the block into the lower 32 bits.

It also slightly refactors the functions so that the method signatures
and types are more consistent with the rest of the impala codebase.

Change-Id: I5f64593e94d367d6b6efb61a8b86e35516f18839
---
M be/src/runtime/sorter.cc
A testdata/workloads/functional-query/queries/QueryTest/large-sorts.test
M tests/query_test/test_queries.py
3 files changed, 76 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/80/2780/1
-- 
To view, visit http://gerrit.cloudera.org:8080/2780
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f64593e94d367d6b6efb61a8b86e35516f18839
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Tim Armstrong <[email protected]>

Reply via email to