From d12e4820fc25186a54d3cc5137371d02f020d890 Mon Sep 17 00:00:00 2001 From: mohan Date: Fri, 28 Jun 2019 16:21:36 +0530 Subject: [PATCH] Fix the CountAttributeAggregator for backward compatibility --- .../CountAttributeAggregatorExecutor.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/CountAttributeAggregatorExecutor.java b/modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/CountAttributeAggregatorExecutor.java index f26d888b3a..3b209dcd36 100644 --- a/modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/CountAttributeAggregatorExecutor.java +++ b/modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/CountAttributeAggregatorExecutor.java @@ -19,6 +19,7 @@ import io.siddhi.annotation.Example; import io.siddhi.annotation.Extension; +import io.siddhi.annotation.Parameter; import io.siddhi.annotation.ParameterOverload; import io.siddhi.annotation.ReturnAttribute; import io.siddhi.annotation.util.DataType; @@ -40,9 +41,18 @@ name = "count", namespace = "", description = "Returns the count of all the events.", - parameters = {}, + parameters = { + @Parameter(name = "arg", + description = "This function accepts one parameter. " + + "It can belong to any one of the available types.", + type = {DataType.INT, DataType.LONG, DataType.DOUBLE, DataType.FLOAT, + DataType.STRING, DataType.BOOL, DataType.OBJECT}, + dynamic = true, + optional = true) + }, parameterOverloads = { - @ParameterOverload() + @ParameterOverload(), + @ParameterOverload(parameterNames = {"arg"}) }, returnAttributes = @ReturnAttribute( description = "Returns the event count as a long.",