|
From: <dm...@us...> - 2010-09-28 10:04:30
|
Revision: 3648
http://bigdata.svn.sourceforge.net/bigdata/?rev=3648&view=rev
Author: dmacgbr
Date: 2010-09-28 10:04:24 +0000 (Tue, 28 Sep 2010)
Log Message:
-----------
Modified operators and corresponding tests for the 'not yet bound' issue. (See Trac #179)
Modified Paths:
--------------
branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java
branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java
branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java
branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java
branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java
branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java
branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQ.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -73,13 +73,13 @@
final IConstant<?> x = s.get((IVariable<?>) get(0)/* x */);
if (x == null)
- return false; // not bound.
+ return true; // not yet bound.
// get binding for "y".
final IConstant<?> y = s.get((IVariable<?>) get(1)/* y */);
if (y == null)
- return false; // not bound.
+ return true; // not yet bound.
return x.equals(y);
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/EQConstant.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -78,7 +78,7 @@
final IConstant<?> asBound = bset.get(var);
if (asBound == null)
- return false; // not bound.
+ return true; // not yet bound.
final IConstant<?> cnst = (IConstant<?>) get(1);
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INBinarySearch.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -181,8 +181,8 @@
if (x == null) {
- // not bound
- return false;
+ // not yet bound : @todo should this reject an unbound variable?
+ return true;
}
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/constraint/INHashMap.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -159,8 +159,8 @@
if (x == null) {
- // not bound.
- return false;
+ // not yet bound.
+ return true;
}
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQ.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -114,7 +114,7 @@
}
- public void test_eval_correct_unblound() {
+ public void test_eval_correct_unbound() {
final EQ op = new EQ(Var.var("x"), Var.var("y"));
@@ -122,7 +122,7 @@
new IVariable[] { Var.var("x") }, //
new IConstant[] { new Constant<String>("1") });
- assertFalse(op.accept(bs1));
+ assertTrue(op.accept(bs1));
}
}
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestEQConstant.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -91,6 +91,6 @@
assertTrue ( op.accept ( eq ) ) ;
assertFalse ( op.accept ( ne1 ) ) ;
assertFalse ( op.accept ( ne2 ) ) ;
- assertFalse ( op.accept ( nb ) ) ;
+ assertTrue ( op.accept ( nb ) ) ;
}
}
\ No newline at end of file
Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java
===================================================================
--- branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java 2010-09-28 09:48:02 UTC (rev 3647)
+++ branches/QUADS_QUERY_BRANCH/bigdata/src/test/com/bigdata/bop/constraint/TestINConstraint.java 2010-09-28 10:04:24 UTC (rev 3648)
@@ -125,7 +125,7 @@
assertTrue ( op.accept ( in ) ) ;
assertFalse ( op.accept ( notin ) ) ;
- assertFalse ( op.accept ( nb ) ) ;
+ assertTrue ( op.accept ( nb ) ) ;
}
protected abstract INConstraint newINConstraint ( IVariable<?> var, IConstant<?> vals [] ) ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|