impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4731: Crash when sorting on non-deterministic expr
Date Mon, 06 Feb 2017 22:02:06 GMT
Tim Armstrong has posted comments on this change.

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

Patch Set 1:

Commit Message:

Line 7: IMPALA-4731: Crash when sorting on non-deterministic expr
This also may fix IMPALA-4728 or IMPALA-397.

Might be good to add a targeted-perf test to confirm it fixes the perf bug IMPALA-4728. I
think Greg Rahn had some examples of analytic functions where lazy materialisation was very
File fe/src/main/java/org/apache/impala/analysis/

Line 194:       } else {
This is a weird corner case case, but I think we should drop LiteralExprs instead of materialising
them. It's plausible that real-world queries might have order-by expressions that can be rewritten
into constants.

Line 207:     substituteOrderingExprs(substOrderBy, analyzer);
I think we only need to substitute the SlotRefs in the first branch of the if() above. We
could just do the substitution there. Otherwise it's a bit hard to reason about materializedOrderingExprs
containing a mix of SlotRefs referring to the old and new tuples.
File tests/query_test/

Line 162:   def test_order_by_random(self):
I think the example in IMPALA-397 would also be a good test - there rand() is in the select
list so we can verify that the order is correct.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I5dcda32fc7770d42fc500ce87fc54d58e5b5dc00
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message