Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify TieredSpationJoin createReprojectMap return result Not comprehensive #1553

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,30 +379,30 @@ public void join(
private Map<Byte, HashSet<Byte>> createReprojectMap(
final Byte[] buildSide,
final Byte[] testSide,
final HashSet<Byte> sharedTiers) {
final Map<Byte, HashSet<Byte>> resultMap = Maps.newHashMap();
final int testLastIndex = testSide.length;
for (final Byte tierLeft : buildSide) {
final int firstGreater = Arrays.binarySearch(testSide, tierLeft);

if (firstGreater >= 0) {
// Found in array
sharedTiers.add(tierLeft);
}

final int insertionPoint = Math.abs(firstGreater);
if (insertionPoint >= testLastIndex) {
// Not present in array, and none greater than this value
continue;
final HashSet<Byte> sharedTiers)
{
final Map<Byte, HashSet<Byte>> resultMap = Maps.newHashMap();
final int testLastIndex = testSide.length;
for (final Byte tierLeft : buildSide)
{
final int firstGreater = Arrays.binarySearch(testSide, tierLeft);
//add same tier id
if (firstGreater >= 0) {
// Found in array
sharedTiers.add(tierLeft);
}
//add highter tier id
HashSet<Byte> higherTiers = Sets.newHashSet();
for(Byte testID :testSide)
{
if(testID>tierLeft)
{
higherTiers.add(testID);
}
}
resultMap.put(tierLeft, higherTiers);
}

// There is at least one value greater than the current copy it and
// add to map
final HashSet<Byte> higherTiers =
Sets.newHashSet(Arrays.copyOfRange(testSide, insertionPoint, testLastIndex));
resultMap.put(tierLeft, higherTiers);
}
return resultMap;
return resultMap;
}

private void setBufferAmount(final double bufferAmount) {
Expand Down