Commit graph

219 commits

Author SHA1 Message Date
Travis Turner
0229c9fae9
avoid overflow bug in differenceRunArray which was appending a full run to the container 2018-02-09 11:42:19 -06:00
Matthew Jaffee
62185a27ba
fix bug where a count query and bitmap query could return different numbers
There was a case where the Bitmap iterator logic could skip over a bit in a run
container if 1. the run container was not the first container in the bitmap, and
2. The first run in the run container had only one bit.

The bug was due to how the iterator was initialized with iterator.Seek(0) which
sets up the initial values of itr.i,j,k based on the type of the first
container. It was failing to set itr.k to -1 unless the first container was an
RLE container. itr.k is only used by RLE containers in the iterator, and must be
set to -1 when an RLE container is encountered. When Iterator.Next() encountered
the run container and itr.k was set to 0, it checked to see if itr.k <= run.last
- run.first, and if so it assumes that it was finished with the run and moved to
the next one. run.last - run.first is 0 in the case of a single bit run, so that
bit was skipped. After this, itr.k is set to -1 and all further iteration
proceeds as expected.
2018-02-06 10:21:11 -06:00
Matthew Jaffee
256b736dc0
add container types to other tests (though they were passing already) 2017-12-07 15:20:53 -06:00
Matthew Jaffee
9d9eb98fa5
add container types and set c.n to get tests working 2017-12-07 14:58:11 -06:00
Matthew Jaffee
8fa965df37
protect against accessing pointers to memory which was unmapped 2017-12-07 14:02:25 -06:00
Todd Gruben
c9c2a2b0d8 added test for differenceRunBitmap overflow bug 2017-11-11 09:44:15 -06:00
Todd Gruben
450dda7fd0 overflow bug in differenceRunBitmap Part 2 2017-11-10 17:01:25 -06:00
Todd Gruben
50d31a3c83 fix overflow in differenceRunBitmap 2017-11-10 12:44:25 -06:00
Travis Turner
681527e37a Merge pull request #859 from travisturner/refactor-differencerunarray
Refactor differencerunarray
2017-09-28 10:31:16 -05:00
Travis
40b27b6643
Fix panic when iterating over an empty run container.
When the difference of two run containers resulted in an empty
container, that container would be a run container with no runs.
The Iterator was expected there to be at least on run in
`container.runs`. This fix protects against that and adds tests
for that case.
2017-09-27 15:11:16 -05:00
Matthew Jaffee
f115249316
don't forget to calculate in in differenceArrayRun 2017-09-27 15:05:27 -05:00
Matthew Jaffee
fd73eaa5cb
re-implement differenceRunArray to not use iterator
hopefully less heap allocs and better perf now
2017-09-27 15:05:16 -05:00
Travis
c7e672e16f
cleaning up a few of the tests 2017-09-27 11:23:00 -05:00
Todd Gruben
de2f16b617
optimzed differenceRunBitmap 2017-09-27 11:23:00 -05:00
Todd Gruben
3f3cc60531
micro optimization to bitmap difference 2017-09-27 11:17:15 -05:00
Todd Gruben
50dab75c82
optimize unionArrayBitmap 2017-09-27 11:17:15 -05:00
Todd Gruben
48f34836e5
optimize differenceBitmapArray 2017-09-27 11:17:15 -05:00
Todd Gruben
08133368e3
optimize differenceArrayBitmap 2017-09-27 11:17:15 -05:00
Todd Gruben
71b7216c51
fix to to allocate properly for difference test 2017-09-27 11:17:15 -05:00
Todd Gruben
4487e6aadd
optimized differenceBitmapBitmap 2017-09-27 11:17:15 -05:00
Matthew Jaffee
de6a25cb8d
rewrite intersectArrayBitmap for perf 2017-09-27 11:17:15 -05:00
Todd Gruben
1736a40b74
check for array conversion to intersectbitmapbitmap 2017-09-27 11:17:14 -05:00
Todd Gruben
1db1ce63b7
optimize intersectionBitmapBitmap 2017-09-27 11:17:14 -05:00
Travis
0d4f634dd8
implement container.flipBitmap() to improve differenceRunBitmap() 2017-09-25 15:48:40 -05:00
Todd Gruben
641519acf2 cleanup on unmarshall shrink 2017-09-15 22:10:48 -05:00
Todd Gruben
1eb2f8d568 reusing containers for memory efficiency 2017-09-07 12:59:09 -05:00
Todd Gruben
a8b070716d reuse fragment memory 2017-09-06 14:41:14 -05:00
Todd Gruben
1d55d1c2c5 cleanup commented code 2017-09-05 15:41:52 -05:00
Todd Gruben
c418d73fa7 zero alloc WriteTo 2017-09-01 14:56:14 -05:00
Todd Gruben
eb98bdd8c6 no allocating WriteTo 2017-09-01 13:39:51 -05:00
Travis
31f1fe0be1
set container.n in differenceRunRun 2017-08-25 19:23:09 -05:00
Travis
cef489c726
ensure new containers have a type 2017-08-25 13:34:57 -05:00
tgruben
644262810f Merge pull request #786 from tgruben/xor-bug
Xor bug
2017-08-24 14:13:25 -05:00
Todd Gruben
72041eb4f2 comment cleanup 2017-08-24 13:49:43 -05:00
Todd Gruben
0f91149852 converted xorArrayRun test to table; xor cardinality bug fix 2017-08-24 13:47:58 -05:00
Todd Gruben
ee3324ba8e overflow in arrayRun with supporting tests 2017-08-23 11:20:33 -05:00
Todd Gruben
95d89e7648 replaced magic number with constant; updated comments 2017-08-23 09:03:26 -05:00
Todd Gruben
343ff04399 fixes #780;adjusted test to avoid array conversion 2017-08-22 16:09:03 -05:00
Matthew Jaffee
dbbdabef05
add failing test for XorRunRun 2017-08-21 14:38:35 -05:00
Travis
cf372cdd1d
Fix infinite loop in bitmap-to-array conversion.
When a run ended the container (i.e. contained column 65535), then the for loop
would increment the 16-bit value to 0, at which point it was still <= 65535.
2017-08-21 14:20:37 -05:00
Matthew Jaffee
23f0d09157
improve description of search32 and search64 2017-08-15 17:47:12 -05:00
Matthew Jaffee
f6b75e0361
fix Bitmap.CountRange bugs, comment, test 2017-08-15 17:07:15 -05:00
Todd Gruben
af4350ca46 spelling correction 2017-08-15 12:36:09 -05:00
Todd Gruben
89b72cbfc8 provided some clarification of CountRange issue 2017-08-15 12:33:19 -05:00
Todd Gruben
7bcbfaef09 fix for #770 2017-08-15 11:36:49 -05:00
Alan Bernstein
056707ad09 Remove unused magic number 2017-08-11 14:02:43 -05:00
Travis
8f3cb3e761
add a comment to TestBitmap_BitmapCountRangeEdgeCase 2017-08-10 08:46:13 -05:00
Todd Gruben
5d39bc0b1c addressing concerns 2017-08-09 15:34:59 -05:00
Todd Gruben
93257af5d2 CountRange was incorrect if rangekey was prior to inital container 2017-08-09 14:06:22 -05:00
Todd Gruben
728308a5bb Merge branch 'master' into 16bitcontainer 2017-08-08 10:17:44 -05:00