urosstan-db commented on code in PR #59615:
URL: https://github.com/apache/spark/pull/59615#discussion_r4328949668
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/vectorExpressions.scala:
##########
@@ -674,11 +674,74 @@ object VectorAvg {
newCount: Long): Unit = {
// Update running average: new_avg = old_avg + (new_value - old_avg) /
new_count
val invCount = 1.0f / newCount
+ if (dim < 4) {
Review Comment:
I am doing this approach because of performances, since it offers up to
15-20% perf boost compared to finite checks for each iteration we have in
updateRemainingElements. One downside is that array that really have a lot
infinite values may run actually slower because of repeated computation.
I am fine with non batched approach as well.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]