Skip to content

Commit

Permalink
Merge branch 'main' into feature/patternModelMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
lbschanno authored Jul 2, 2024
2 parents 12e4a14 + 02b63fd commit d5f2e05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<relativePath>../../../microservices/microservice-parent/pom.xml</relativePath>
</parent>
<artifactId>metadata-utils</artifactId>
<version>4.0.4-SNAPSHOT</version>
<version>4.0.6-SNAPSHOT</version>
<url>https://code.nsa.gov/datawave-metadata-utils</url>
<licenses>
<license>
Expand Down
17 changes: 15 additions & 2 deletions src/main/java/datawave/query/util/AllFieldMetadataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.user.RegExFilter;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableUtils;
Expand Down Expand Up @@ -1270,9 +1271,9 @@ public Map<String,Map<String,FieldIndexHole>> getReversedFieldIndexHoles(Set<Str
* @param targetColumnFamily
* the target column family
* @param fields
* a set of fields
* a set of fields for which to get holes (can be empty to denote all)
* @param datatypes
* a set of datatypes
* a set of datatypes (can be empty to denote all)
* @param minThreshold
* the minimum threshold
* @return a map of index holes by datatype
Expand Down Expand Up @@ -1314,10 +1315,17 @@ private Map<String,Map<String,FieldIndexHole>> getFieldIndexHoles(Text targetCol
indexedFields.addAll(indexedFieldMap.get(datatype));
}
}

// if the initial fields list is empty, then we want all possible holes
if (fields.isEmpty()) {
fields = indexedFields;
} else {
fields.retainAll(indexedFields);

// if we have removed all fields, then there are no fields for which we can generate holes
if (fields.isEmpty()) {
return new HashMap<>();
}
}

// Ensure the minThreshold is a percentage in the range 0%-100%.
Expand Down Expand Up @@ -1378,6 +1386,11 @@ public boolean getBoundaryValue() {
public long getCount() {
return this.count;
}

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}

/**
Expand Down

0 comments on commit d5f2e05

Please sign in to comment.