@@ -96,15 +96,15 @@ case class Sum(child: Expression) extends DeclarativeAggregate with ImplicitCast
9696
9797 /**
9898 * For decimal type:
99- * If isEmpty is false and if sum is null, then it means we have an overflow.
99+ * If isEmpty is false and if sum is null, then it means we have had an overflow.
100100 *
101101 * update of the sum is as follows:
102102 * Check if either portion of the left.sum or right.sum has overflowed
103103 * If it has, then the sum value will remain null.
104- * If it did not have overflow, then add the sum.left and sum.right and check for overflow.
104+ * If it did not have overflow, then add the sum.left and sum.right
105105 *
106106 * isEmpty: Set to false if either one of the left or right is set to false. This
107- * means we have seen atleast a row that was not null.
107+ * means we have seen atleast a value that was not null.
108108 */
109109 override lazy val mergeExpressions : Seq [Expression ] = {
110110 val mergeSumExpr = coalesce(coalesce(sum.left, zero) + sum.right, sum.left)
@@ -120,8 +120,8 @@ case class Sum(child: Expression) extends DeclarativeAggregate with ImplicitCast
120120 }
121121
122122 /**
123- * If the isEmpty is true, then it means either there are no rows, or all the rows were
124- * null, so the result will be null.
123+ * If the isEmpty is true, then it means there were no values to begin with or all the values
124+ * were null, so the result will be null.
125125 * If the isEmpty is false, then if sum is null that means an overflow has happened.
126126 * So now, if ansi is enabled, then throw exception, if not then return null.
127127 * If sum is not null, then return the sum.
0 commit comments