Author: Thomas Tauber-Marshall <firstname.lastname@example.org>
Date: Tue Jan 31 10:33:07 2017 -0800
IMPALA-4731/ IMPALA-397/ IMPALA-4728: Materialize sort exprs
Previously, exprs used in sorts were evaluated lazily. This can
potentially be bad for performance if the exprs are expensive to
evaluate, and it can lead to crashes if the exprs are
non-deterministic, as this violates assumptions of our sorting
This patch addresses these issues by materializing ordering exprs.
It does so when the expr is non-deterministic (including when it
contains a UDF, which we cannot currently know if they are
non-deterministic), or when its cost exceeds a threshold (or the
cost is unknown).
- Added e2e tests in test_sort.py.
- Updated planner tests.
Reviewed-by: Thomas Tauber-Marshall <email@example.com>
Tested-by: Impala Public Jenkins