Skip to content

Commit 65b6ff1

Browse files
committed
Modify the literal value of the result of transformation from Sum to long value.
1 parent 830c20b commit 65b6ff1

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ object NullPropagation extends Rule[LogicalPlan] {
101101
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
102102
case q: LogicalPlan => q transformExpressionsUp {
103103
case e @ Count(Literal(null, _)) => Cast(Literal(0L), e.dataType)
104-
case e @ Sum(Literal(c, _)) if c == 0 => Cast(Literal(0), e.dataType)
104+
case e @ Sum(Literal(c, _)) if c == 0 => Cast(Literal(0L), e.dataType)
105105
case e @ Average(Literal(c, _)) if c == 0 => Literal(0.0, e.dataType)
106106
case e @ IsNull(c) if c.nullable == false => Literal(false, BooleanType)
107107
case e @ IsNotNull(c) if c.nullable == false => Literal(true, BooleanType)

0 commit comments

Comments
 (0)