Skip to content
Snippets Groups Projects
Commit 41a3f934 authored by Daoyuan Wang's avatar Daoyuan Wang Committed by Michael Armbrust
Browse files

[SPARK-4829] [SQL] add rule to fold count(expr) if expr is not null

Author: Daoyuan Wang <daoyuan.wang@intel.com>

Closes #3676 from adrian-wang/countexpr and squashes the following commits:

dc5765b [Daoyuan Wang] add rule to fold count(expr) if expr is not null
parent 8091dd62
No related branches found
No related tags found
No related merge requests found
......@@ -210,6 +210,7 @@ object NullPropagation extends Rule[LogicalPlan] {
case e @ GetField(Literal(null, _), _) => Literal(null, e.dataType)
case e @ EqualNullSafe(Literal(null, _), r) => IsNull(r)
case e @ EqualNullSafe(l, Literal(null, _)) => IsNull(l)
case e @ Count(expr) if !expr.nullable => Count(Literal(1))
// For Coalesce, remove null literals.
case e @ Coalesce(children) =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment