JENA-817 : Fix for sum(...) of an empty group. Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/a539ff03 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/a539ff03 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/a539ff03
Branch: refs/heads/hadoop-rdf Commit: a539ff032d6bb10629dc88cfd9d27a87db53c2be Parents: e97b0dd Author: Andy Seaborne <[email protected]> Authored: Mon Nov 24 11:29:30 2014 +0000 Committer: Andy Seaborne <[email protected]> Committed: Mon Nov 24 11:29:30 2014 +0000 ---------------------------------------------------------------------- .../main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java | 3 ++- jena-arq/testing/ARQ/GroupBy/agg-1.srj | 3 ++- jena-arq/testing/ARQ/GroupBy/agg-2.srj | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/a539ff03/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java ---------------------------------------------------------------------- diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java index 8fc2e24..e9eb6e6 100644 --- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java +++ b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/aggregate/AggSum.java @@ -53,10 +53,11 @@ public class AggSum extends AggregatorBase public Expr getExpr() { return expr ; } @Override - public Node getValueEmpty() { return null ; } //return NodeValue.toNode(noValuesToSum) ; } + public Node getValueEmpty() { return NodeValue.toNode(noValuesToSum) ; } @Override public int hashCode() { return HC_AggSum ^ expr.hashCode() ; } + @Override public boolean equals(Object other) { http://git-wip-us.apache.org/repos/asf/jena/blob/a539ff03/jena-arq/testing/ARQ/GroupBy/agg-1.srj ---------------------------------------------------------------------- diff --git a/jena-arq/testing/ARQ/GroupBy/agg-1.srj b/jena-arq/testing/ARQ/GroupBy/agg-1.srj index fd2ec40..391b3b5 100644 --- a/jena-arq/testing/ARQ/GroupBy/agg-1.srj +++ b/jena-arq/testing/ARQ/GroupBy/agg-1.srj @@ -5,7 +5,8 @@ "results": { "bindings": [ { - "C": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } + "C": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } , + "S": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } } ] } http://git-wip-us.apache.org/repos/asf/jena/blob/a539ff03/jena-arq/testing/ARQ/GroupBy/agg-2.srj ---------------------------------------------------------------------- diff --git a/jena-arq/testing/ARQ/GroupBy/agg-2.srj b/jena-arq/testing/ARQ/GroupBy/agg-2.srj index fd2ec40..391b3b5 100644 --- a/jena-arq/testing/ARQ/GroupBy/agg-2.srj +++ b/jena-arq/testing/ARQ/GroupBy/agg-2.srj @@ -5,7 +5,8 @@ "results": { "bindings": [ { - "C": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } + "C": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } , + "S": { "datatype": "http://www.w3.org/2001/XMLSchema#integer" , "type": "typed-literal" , "value": "0" } } ] }
