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-4192: Disentangle Expr and ExprContext
Date Fri, 20 Jan 2017 02:40:50 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-4192: Disentangle Expr and ExprContext

Patch Set 4:


I had some high level comments. Still trying to understand the flow of execution with the
various Open()/Close()/Clone() etc calls.
Commit Message:

PS4, Line 31: soly

PS4, Line 39: ignorning
File be/src/exprs/

PS4, Line 129: RegisterFnContexts
CreateFnContexts()? I don't think there's any real registration going on here.
File be/src/exprs/expr-context.h:

Line 86:   /// Use this interface except for creating ExprContext on a stack.
It looks like we only do this in two places in ExprTest. Why not change those to use Create()
and hide the constructor?

Line 102:   /// Convenience function for closing multiple expr trees.
Are we closing the expr trees or the contexts? Same for the comments above too.
File be/src/exprs/

Line 376: Status Expr::Prepare(RuntimeState* state, const RowDescriptor& row_desc) {
It's kind of weird that the scope of what is initialised is different for Expr::Prepare()
vs Expr::Open() and Expr::Close().

Expr::Prepare() just initialises the Expr and doesn't do anything with ExprContext, but Expr::Open()
and Expr::Close() initialize the ExprContext. We need something like this because there's
Expr-subclass-specific logic in Open() and Close(). Maybe Open() and Close() should be OpenContext()
and CloseContext() instead so the distinction is clearer?

Line 412: string Expr::DebugString(const vector<ExprContext*>& ctxs) {
This should probably be moved to ExprContext too, right?
File be/src/exprs/expr.h:

PS4, Line 100:  its
             : /// states
What is "its states"

Line 110: /// TODO:
Remove TODO's while we're here? These seem too non-specific to be useful.

PS4, Line 354: on the expr tree.
It's really opening the ExprContext and FunctionContexts instead of the expr tree, right?

Line 358:   /// Subclasses overriding this function should call Expr::Close().
This really closes the ExprContext instead of the Expr.

This makes sense since we may need Expr-subclass-specific logic, but the comment should be

PS4, Line 387: FunctionContext

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefdc9aeeba033355cb9497e3a5d2363627dcf2f3
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Michael Ho <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message