From: <jer...@us...> - 2013-10-10 17:18:47
|
Revision: 7446 http://bigdata.svn.sourceforge.net/bigdata/?rev=7446&view=rev Author: jeremy_carroll Date: 2013-10-10 17:18:39 +0000 (Thu, 10 Oct 2013) Log Message: ----------- revert MIN / MAX changes ahead of further discussion Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MAX.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MIN.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java Removed Paths: ------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.srx branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.srx branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.srx branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min-max.ttl branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.srx branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.srx branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.srx Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MAX.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MAX.java 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MAX.java 2013-10-10 17:18:39 UTC (rev 7446) @@ -32,7 +32,6 @@ import com.bigdata.bop.IBindingSet; import com.bigdata.bop.IValueExpression; import com.bigdata.bop.aggregate.AggregateBase; -import com.bigdata.bop.solutions.IVComparator; import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.constraints.CompareBOp; import com.bigdata.rdf.internal.constraints.INeedsMaterialization; @@ -58,8 +57,6 @@ * */ private static final long serialVersionUID = 1L; - - private static IVComparator comparator = new IVComparator(); public MAX(MAX op) { super(op); @@ -124,7 +121,15 @@ } else { - if (comparator.compare(iv, max)>0) { + /** + * FIXME This needs to use the ordering define by ORDER_BY. The + * CompareBOp imposes the ordering defined for the "<" operator + * which is less robust and will throw a type exception if you + * attempt to compare unlike Values. + * + * @see https://sourceforge.net/apps/trac/bigdata/ticket/300#comment:5 + */ + if (CompareBOp.compare(iv, max, CompareOp.GT)) { max = iv; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MIN.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MIN.java 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/bop/rdf/aggregate/MIN.java 2013-10-10 17:18:39 UTC (rev 7446) @@ -35,7 +35,6 @@ import com.bigdata.bop.IValueExpression; import com.bigdata.bop.aggregate.AggregateBase; import com.bigdata.bop.aggregate.IAggregate; -import com.bigdata.bop.solutions.IVComparator; import com.bigdata.rdf.internal.IV; import com.bigdata.rdf.internal.constraints.CompareBOp; import com.bigdata.rdf.internal.constraints.INeedsMaterialization; @@ -57,15 +56,12 @@ public class MIN extends AggregateBase<IV> implements INeedsMaterialization{ // private static final transient Logger log = Logger.getLogger(MIN.class); - /** * */ private static final long serialVersionUID = 1L; - private static IVComparator comparator = new IVComparator(); - public MIN(MIN op) { super(op); } @@ -129,7 +125,15 @@ } else { - if (comparator.compare(iv, min)<0) { + /** + * FIXME This needs to use the ordering define by ORDER_BY. The + * CompareBOp imposes the ordering defined for the "<" operator + * which is less robust and will throw a type exception if you + * attempt to compare unlike Values. + * + * @see https://sourceforge.net/apps/trac/bigdata/ticket/300#comment:5 + */ + if (CompareBOp.compare(iv, min, CompareOp.LT)) { min = iv; Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestTickets.java 2013-10-10 17:18:39 UTC (rev 7446) @@ -253,76 +253,4 @@ } - - public void test_ticket_min736() throws Exception { - - new TestHelper("aggregate-min",// testURI, - "aggregate-min.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-min.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } - - public void test_ticket_max736() throws Exception { - - new TestHelper("aggregate-max",// testURI, - "aggregate-max.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-max.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } - - public void test_ticket_min736_1() throws Exception { - - new TestHelper("aggregate-min1",// testURI, - "aggregate-min1.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-min1.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } - - public void test_ticket_max736_1() throws Exception { - - new TestHelper("aggregate-max1",// testURI, - "aggregate-max1.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-max1.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } - - public void test_ticket_min736_2() throws Exception { - - new TestHelper("aggregate-min2",// testURI, - "aggregate-min2.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-min2.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } - - public void test_ticket_max736_2() throws Exception { - - new TestHelper("aggregate-max2",// testURI, - "aggregate-max2.rq",// queryFileURL - "aggregate-min-max.ttl",// dataFileURL - "aggregate-max2.srx",// resultFileURL - false, // laxCardinality - true // checkOrder - ).runTest(); - - } } Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,8 +0,0 @@ - -prefix : <http://example/> - -SELECT (MAX(?o) AS ?m) -WHERE { - ?s :p ?o -} - Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"> - <literal datatype="http://www.w3.org/2001/XMLSchema#integer">3</literal> - </binding> - </result> - </results> -</sparql> Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,8 +0,0 @@ - -prefix : <http://example/> - -SELECT (MAX(?o) AS ?m) -WHERE { - ?s :q ?o -} - Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max1.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"> - <literal xml:lang="en">bigdata</literal> - </binding> - </result> - </results> -</sparql> Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,8 +0,0 @@ - -prefix : <http://example/> - -SELECT (MAX(?o) AS ?m) -WHERE { - ?s ?p ?o -} - Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-max2.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"> - <literal datatype="http://www.w3.org/2001/XMLSchema#integer">3</literal> - </binding> - </result> - </results> -</sparql> Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min-max.ttl =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min-max.ttl 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min-max.ttl 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,10 +0,0 @@ -@prefix : <http://example/> . - -:x1 :p 1.5 . -:x1 :p 3 . -:x1 :p :x2 . -:x1 :q "bigdata"@en. -:x1 :q "bigdata"@de. -:x1 :r <http://www.bigdata.com/blog/> . - - Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,6 +0,0 @@ -prefix : <http://example/> - -SELECT (MIN(?o) AS ?m) -WHERE { - ?s :p ?o -} Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"><uri>http://example/x2</uri></binding> - </result> - </results> -</sparql> Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,6 +0,0 @@ -prefix : <http://example/> - -SELECT (MIN(?o) AS ?m) -WHERE { - ?s :q ?o -} Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min1.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,17 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"> - <literal - xml:lang="de">bigdata</literal> - </binding> - </result> - </results> -</sparql> Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.rq 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.rq 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,6 +0,0 @@ -prefix : <http://example/> - -SELECT (MIN(?o) AS ?m) -WHERE { - ?s ?p ?o -} Deleted: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.srx 2013-10-10 00:34:02 UTC (rev 7445) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/aggregate-min2.srx 2013-10-10 17:18:39 UTC (rev 7446) @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<sparql - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xs="http://www.w3.org/2001/XMLSchema#" - xmlns="http://www.w3.org/2005/sparql-results#" > - <head> - <variable name="m"/> - </head> - <results> - <result> - <binding name="m"><uri>http://example/x2</uri></binding> - </result> - </results> -</sparql> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |