tanishqgandhi1908 commented on code in PR #5896:
URL: https://github.com/apache/texera/pull/5896#discussion_r3469200735
##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/aggregate/AggregationOperation.scala:
##########
@@ -77,26 +93,28 @@ class AggregationOperation {
@JsonIgnore
def getAggregationAttribute(attrType: AttributeType): Attribute = {
val resultAttrType = this.aggFunction match {
- case AggregationFunction.SUM => attrType
- case AggregationFunction.COUNT => AttributeType.INTEGER
- case AggregationFunction.AVERAGE => AttributeType.DOUBLE
- case AggregationFunction.MIN => attrType
- case AggregationFunction.MAX => attrType
- case AggregationFunction.CONCAT => AttributeType.STRING
- case _ => throw new RuntimeException("Unknown
aggregation function: " + this.aggFunction)
+ case AggregationFunction.SUM => attrType
+ case AggregationFunction.COUNT => AttributeType.INTEGER
+ case AggregationFunction.COUNT_STAR => AttributeType.INTEGER
+ case AggregationFunction.AVERAGE => AttributeType.DOUBLE
+ case AggregationFunction.MIN => attrType
+ case AggregationFunction.MAX => attrType
+ case AggregationFunction.CONCAT => AttributeType.STRING
+ case _ => throw new
RuntimeException("Unknown aggregation function: " + this.aggFunction)
}
new Attribute(resultAttribute, resultAttrType)
}
@JsonIgnore
def getAggFunc(attrType: AttributeType): DistributedAggregation[Object] = {
val aggFunc = aggFunction match {
- case AggregationFunction.AVERAGE => averageAgg()
- case AggregationFunction.COUNT => countAgg()
- case AggregationFunction.MAX => maxAgg(attrType)
- case AggregationFunction.MIN => minAgg(attrType)
- case AggregationFunction.SUM => sumAgg(attrType)
- case AggregationFunction.CONCAT => concatAgg()
+ case AggregationFunction.AVERAGE => averageAgg()
+ case AggregationFunction.COUNT => countAgg()
+ case AggregationFunction.COUNT_STAR => countStarAgg()
Review Comment:
Merged the two count methods into one countAgg(countAllRows: Boolean) so
there's no separate countStarAgg
--
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]