benWize commented on a change in pull request #15174:
URL: https://github.com/apache/beam/pull/15174#discussion_r698875353
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/agg/CovarianceFn.java
##########
@@ -124,6 +124,11 @@ private BigDecimal getCovariance(CovarianceAccumulator
covariance) {
BigDecimal adjustedCount =
this.isSample ? covariance.count().subtract(BigDecimal.ONE) :
covariance.count();
+ // Avoid ArithmeticException: Division is undefined when adjustedCount and
covariance are 0
Review comment:
Yes, I changed the validation and comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]