Skip to content

Commit

Permalink
security
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Dec 11, 2023
1 parent 6f584e4 commit 8922532
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,13 +727,19 @@ public ArrayCompressionStatistics statistics(int nSamples) {
d.put(key, 1);
}
Pair<ValueType, Boolean> vt = analyzeValueType(nSamples);
if(vt.getKey() == ValueType.UNKNOWN)
vt = analyzeValueType();

if(vt.getKey() == ValueType.UNKNOWN)
vt = new Pair<>(ValueType.STRING, false);

final int[] freq = new int[d.size()];
int id = 0;
for(Entry<T, Integer> e : d.entrySet())
freq[id++] = e.getValue();

int estDistinct = SampleEstimatorFactory.distinctCount(freq, size(), nSamples);

// memory size is different depending on valuetype.
long memSize = vt.getKey() != getValueType() ? //
ArrayFactory.getInMemorySize(vt.getKey(), size(), containsNull()) : //
Expand Down

0 comments on commit 8922532

Please sign in to comment.