Yonghyun Hwang has uploaded a new change for review. http://gerrit.cloudera.org:8080/4600
Change subject: IMPALA-4042: count(distinct NULL) fails on a view ...................................................................... IMPALA-4042: count(distinct NULL) fails on a view 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, "NULL_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, Expr.trySubstitute() is updated not to substitue NullLiteral. Change-Id: Icf3b4511234e473e5b9548fbf3e97f333c9980f1 --- M fe/src/main/java/com/cloudera/impala/analysis/Expr.java M testdata/workloads/functional-planner/queries/PlannerTest/aggregation.test 2 files changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/00/4600/1 -- To view, visit http://gerrit.cloudera.org:8080/4600 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf3b4511234e473e5b9548fbf3e97f333c9980f1 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Yonghyun Hwang <yongh...@cloudera.com>