You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2014/04/02 06:12:09 UTC

[29/50] [abbrv] git commit: Updated the comparator to actually check the two values.

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/c97d8175
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/c97d8175
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/c97d8175

Branch: refs/heads/prestonc/hash_join
Commit: c97d817579fdfa313c63819e52af085d1a4b9a68
Parents: c3a7ce2
Author: Preston Carman <pr...@apache.org>
Authored: Mon Mar 31 16:11:22 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:25 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/c97d8175/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;
                 }
             };
         }