IMPALA-4452: Always call AggFnEvaluator::Open() before AggFnEvaluator::Init()
As part of the fix for
IMPALA-2379, the expression contexts of
aggregation function evaluators are expected to be opened before
their initFn() are called so \ constant arguments can be accessed
in initFn(). However, the legacy aggregation node wasn't updated
to follow this order for singleton result tuple (i.e. no group-by).
This patch fixes the problem by deferring the creation of the
singleton tuple to a point in AggregationNode::Open() after the
expression contexts of all aggregate function evaluators have
been opened. PartitionedAggregationNode() was already updated
to follow this order.
This patch also fixes a minor bug in which uninitialized entries
of agg_fn_ctxs_ may be accessed in AggregationNode::Close()
if AggregationNode::Prepare() fails.
Reviewed-by: Michael Ho <email@example.com>
Tested-by: Internal Jenkins