diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2006-09-20 03:00:40 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2006-09-20 03:00:40 +0000 |
commit | c16716f2d8e15f6539995c656ad05e4e8f799a21 (patch) | |
tree | 55a1bac1f15d23fbea3b665a56f1d94ccc5842ef /src/main/java/com/amazon/carbonado/qe | |
parent | 1c9a5991aa49724c34a20fcea6fd1252ce03b8d9 (diff) |
More tests and fixes.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/qe')
-rw-r--r-- | src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java index c64e4d4..b06edba 100644 --- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java +++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -179,7 +179,9 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact Map<ChainedProperty<S>, Tally> superKey = new LinkedHashMap<ChainedProperty<S>, Tally>();
for (Set<ChainedProperty<S>> key : keys) {
for (ChainedProperty<S> property : key) {
- superKey.put(property, new Tally(property));
+ if (!superKey.containsKey(property)) {
+ superKey.put(property, new Tally(property));
+ }
}
}
@@ -274,7 +276,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact }
int propCount = index.getPropertyCount();
- Set<ChainedProperty<S>> props = new HashSet<ChainedProperty<S>>(propCount);
+ Set<ChainedProperty<S>> props = new LinkedHashSet<ChainedProperty<S>>(propCount);
for (int i=0; i<propCount; i++) {
props.add(index.getOrderedProperty(i).getChainedProperty());
@@ -287,7 +289,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact }
private Set<ChainedProperty<S>> stripOrdering(Set<? extends OrderedProperty<S>> orderedProps) {
- Set<ChainedProperty<S>> props = new HashSet<ChainedProperty<S>>(orderedProps.size());
+ Set<ChainedProperty<S>> props = new LinkedHashSet<ChainedProperty<S>>(orderedProps.size());
for (OrderedProperty<S> ordering : orderedProps) {
props.add(ordering.getChainedProperty());
}
|