Github user kchilton2 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/251#discussion_r153264717 --- Diff: extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/JoinResultUpdater.java --- @@ -231,30 +225,38 @@ public void updateJoinResults( * @param siblingId - Id of the sibling node whose BindingSets will be retrieved and joined with the update * @return Span to retrieve sibling node's BindingSets to form join results */ - private Span getSpan(TransactionBase tx, final String childId, final BindingSet childBindingSet, final String siblingId) { + private Span getSpan(TransactionBase tx, final String childId, final VisibilityBindingSet childBindingSet, final String siblingId) { // Get the common variable orders. These are used to build the prefix. final VariableOrder childVarOrder = getVarOrder(tx, childId); final VariableOrder siblingVarOrder = getVarOrder(tx, siblingId); final List<String> commonVars = getCommonVars(childVarOrder, siblingVarOrder); - // Get the Binding strings - final String childBindingSetString = VIS_BS_CONVERTER.convert(childBindingSet, childVarOrder); - final String[] childBindingArray = childBindingSetString.split("\u0001"); - final String[] childBindingStrings = FluoStringConverter.toBindingStrings(childBindingArray[0]); - - // Create the prefix that will be used to scan for binding sets of the sibling node. - // This prefix includes the sibling Node ID and the common variable values from - // childBindingSet. - String siblingScanPrefix = ""; - for(int i = 0; i < commonVars.size(); i++) { - if(siblingScanPrefix.length() == 0) { - siblingScanPrefix = childBindingStrings[i]; - } else { - siblingScanPrefix += DELIM + childBindingStrings[i]; - } +// // Get the Binding strings +// final String childBindingSetString = VIS_BS_CONVERTER.convert(childBindingSet, childVarOrder); +// final String[] childBindingArray = childBindingSetString.split("\u0001"); +// final String[] childBindingStrings = FluoStringConverter.toBindingStrings(childBindingArray[0]); + + Bytes scanPrefix = null; + if(!commonVars.isEmpty()) { + scanPrefix = getRowKey(siblingId, new VariableOrder(commonVars), childBindingSet); + } else { + scanPrefix = getRowKey(siblingId, siblingVarOrder, childBindingSet); } - siblingScanPrefix = siblingId + NODEID_BS_DELIM + siblingScanPrefix; - return Span.prefix(siblingScanPrefix); +// --- End diff -- Delete commented out code.
---