Updated the comparator to actually check the two values.

Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/839685ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/839685ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/839685ac

Branch: refs/heads/prestonc/hash_join
Commit: 839685ac7ce23c477c05e38dd0e37051f77f3f04
Parents: 7bfbc99
Author: Preston Carman <[email protected]>
Authored: Mon Mar 31 16:11:22 2014 -0700
Committer: Preston Carman <[email protected]>
Committed: Mon Mar 31 16:11:22 2014 -0700

----------------------------------------------------------------------
 .../compiler/algebricks/VXQueryComparatorFactoryProvider.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/839685ac/vxquery-core/src/main/java/org/apache/vxquery/compiler/algebricks/VXQueryComparatorFactoryProvider.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/compiler/algebricks/VXQueryComparatorFactoryProvider.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/compiler/algebricks/VXQueryComparatorFactoryProvider.java
index 5a0e2df..10da31e 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/compiler/algebricks/VXQueryComparatorFactoryProvider.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/compiler/algebricks/VXQueryComparatorFactoryProvider.java
@@ -48,7 +48,12 @@ public class VXQueryComparatorFactoryProvider implements 
IBinaryComparatorFactor
                 public int compare(byte[] b1, int s1, int l1, byte[] b2, int 
s2, int l2) {
                     tvp1.set(b1, s1, l1);
                     tvp2.set(b2, s2, l2);
-                    return 0;
+                    for (int i = 0; i < l1 && i < l2; ++i) {
+                        if (b1[s1 + i] != b2[s2 + i]) {
+                            return b1[s1 + i] - b2[s2 + i];
+                        }
+                    }
+                    return l1 - l2;
                 }
             };
         }

Reply via email to