Thomas Tauber-Marshall has uploaded a new patch set (#2).

Change subject: IMPALA-4731: Crash when sorting on non-deterministic expr
......................................................................

IMPALA-4731: Crash when sorting on non-deterministic expr

When sorting on a non-deterministic expr, eg. 'order by random()',
we lazily evaluate the exprs being sorted on, leading to a different
value being generated for each tuple each time it is compared to
something during the sort.

This leads to violations of assumptions made by our sorting algorithm,
eg. in insertion sort the assumption that the portion that has already
been processed is in fact in sorted order, which leads to DCHECK
failures and crashes.

The fix is to switch from lazy evaluation to eager evaluation by
materializing the exprs into the sort tuple.

This also addresses IMPALA-397.

Testing:
- Added e2e test in test_sort.py that verifies 'order by random()'
  behaves as expected.

Change-Id: I5dcda32fc7770d42fc500ce87fc54d58e5b5dc00
---
M fe/src/main/java/org/apache/impala/analysis/SortInfo.java
M testdata/workloads/functional-query/queries/QueryTest/sort.test
M tests/query_test/test_sort.py
3 files changed, 86 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/14/5914/2
-- 
To view, visit http://gerrit.cloudera.org:8080/5914
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5dcda32fc7770d42fc500ce87fc54d58e5b5dc00
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <tmarsh...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to