Thomas Tauber-Marshall has uploaded a new change for review. http://gerrit.cloudera.org:8080/5914
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. 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, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/14/5914/1 -- To view, visit http://gerrit.cloudera.org:8080/5914 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5dcda32fc7770d42fc500ce87fc54d58e5b5dc00 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Thomas Tauber-Marshall <tmarsh...@cloudera.com>