impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Internal Jenkins (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4042: Preserve root types when substituting grouping exprs
Date Wed, 05 Oct 2016 03:04:17 GMT
Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-4042: Preserve root types when substituting grouping exprs

IMPALA-4042: Preserve root types when substituting grouping exprs

In case of count(distinct), FunctionCallExpr.analyze() changes type
for "NULL" into "BOOLEAN" to make sure that BE doesn't see any
"NULL_TYPE" exprs. In the meantime, Expr substitution, happening in
Expr.substituteImpl() reverts this change back to original type,

This causes an issue when AggregateInfo.checkConsistency() performs
precondition check where slot types from
AggregateInfo.outputTupleDesc_ should be matched with the types from
AggregateInfo.groupingExpr_. The slot type shows "BOOLEAN" while type
from groupingExpr_ is "NULL_TYPE", which makes the precondition fail
and throws an exception.

To resolve the issue, preserveRootType is set to true when
Expr.substituteList() gets called in AggregateInfo.substitute()

Change-Id: Icf3b4511234e473e5b9548fbf3e97f333c9980f1
(cherry picked from commit b17785b4890bedd1c825140ce3c48cd7d9734295)
Reviewed-by: Alex Behm <>
Tested-by: Internal Jenkins
M fe/src/main/java/org/apache/impala/analysis/
M testdata/workloads/functional-planner/queries/PlannerTest/distinct.test
2 files changed, 25 insertions(+), 1 deletion(-)

  Internal Jenkins: Verified
  Alex Behm: Looks good to me, approved

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf3b4511234e473e5b9548fbf3e97f333c9980f1
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Yonghyun Hwang <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Huaisi Xu <>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Yonghyun Hwang

View raw message