diff options
Diffstat (limited to 'src/mongo/db/exec/bucket_unpacker_test.cpp')
-rw-r--r-- | src/mongo/db/exec/bucket_unpacker_test.cpp | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/src/mongo/db/exec/bucket_unpacker_test.cpp b/src/mongo/db/exec/bucket_unpacker_test.cpp index 8ee0f4e05f5..ce5065318be 100644 --- a/src/mongo/db/exec/bucket_unpacker_test.cpp +++ b/src/mongo/db/exec/bucket_unpacker_test.cpp @@ -220,7 +220,8 @@ TEST_F(BucketUnpackerTest, ExcludeASingleField) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, EmptyIncludeGetsEmptyMeasurements) { @@ -246,7 +247,8 @@ TEST_F(BucketUnpackerTest, EmptyIncludeGetsEmptyMeasurements) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, EmptyExcludeMaterializesAllFields) { @@ -274,7 +276,8 @@ TEST_F(BucketUnpackerTest, EmptyExcludeMaterializesAllFields) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, SparseColumnsWhereOneColumnIsExhaustedBeforeTheOther) { @@ -300,7 +303,8 @@ TEST_F(BucketUnpackerTest, SparseColumnsWhereOneColumnIsExhaustedBeforeTheOther) }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, UnpackBasicIncludeWithDollarPrefix) { @@ -329,7 +333,8 @@ TEST_F(BucketUnpackerTest, UnpackBasicIncludeWithDollarPrefix) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, BucketsWithMetadataOnly) { @@ -354,7 +359,8 @@ TEST_F(BucketUnpackerTest, BucketsWithMetadataOnly) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, UnorderedRowKeysDoesntAffectMaterialization) { @@ -412,7 +418,8 @@ TEST_F(BucketUnpackerTest, MissingMetaFieldDoesntMaterializeMetadata) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, MissingMetaFieldDoesntMaterializeMetadataUnorderedKeys) { @@ -467,7 +474,8 @@ TEST_F(BucketUnpackerTest, ExcludedMetaFieldDoesntMaterializeMetadataWhenBucketH }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, UnpackerResetThrowsOnUndefinedMeta) { @@ -486,7 +494,8 @@ TEST_F(BucketUnpackerTest, UnpackerResetThrowsOnUndefinedMeta) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, UnpackerResetThrowsOnUnexpectedMeta) { @@ -506,7 +515,8 @@ TEST_F(BucketUnpackerTest, UnpackerResetThrowsOnUnexpectedMeta) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, NullMetaInBucketMaterializesAsNull) { @@ -533,7 +543,8 @@ TEST_F(BucketUnpackerTest, NullMetaInBucketMaterializesAsNull) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, GetNextHandlesMissingMetaInBucket) { @@ -565,7 +576,8 @@ TEST_F(BucketUnpackerTest, GetNextHandlesMissingMetaInBucket) { }; test(bucket); - test(*timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket); + test(*timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket); } TEST_F(BucketUnpackerTest, EmptyDataRegionInBucketIsTolerated) { @@ -887,7 +899,8 @@ TEST_F(BucketUnpackerTest, TamperedCompressedCountLess) { "a:{'0':1, '1':2}, b:{'1':1}}}"); auto compressedBucket = - timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket; + timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket; // Reduce the count by one to be 1. auto modifiedCompressedBucket = modifyCompressedBucketElementCount(*compressedBucket, -1); @@ -922,7 +935,8 @@ TEST_F(BucketUnpackerTest, TamperedCompressedCountMore) { "a:{'0':1, '1':2}, b:{'1':1}}}"); auto compressedBucket = - timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket; + timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket; // Increase the count by one to be 3. auto modifiedCompressedBucket = modifyCompressedBucketElementCount(*compressedBucket, 1); @@ -957,7 +971,8 @@ TEST_F(BucketUnpackerTest, TamperedCompressedCountMissing) { "a:{'0':1, '1':2}, b:{'1':1}}}"); auto compressedBucket = - timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket; + timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket; // Remove the count field auto modifiedCompressedBucket = modifyCompressedBucketElementCount(*compressedBucket, 0); @@ -993,7 +1008,8 @@ TEST_F(BucketUnpackerTest, TamperedCompressedElementMismatchDataField) { "a:{'0':1, '1':2}, b:{'1':1}}}"); auto compressedBucket = - timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket; + timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket; // Remove an element in the "a" field. auto modifiedCompressedBucket = modifyCompressedBucketRemoveLastInField(*compressedBucket, "a"_sd); @@ -1028,7 +1044,8 @@ TEST_F(BucketUnpackerTest, TamperedCompressedElementMismatchTimeField) { "a:{'0':1, '1':2}, b:{'1':1}}}"); auto compressedBucket = - timeseries::compressBucket(bucket, "time"_sd, {}, false).compressedBucket; + timeseries::compressBucket(bucket, "time"_sd, {}, /*eligibleForReopening=*/false, false) + .compressedBucket; // Remove an element in the time field auto modifiedCompressedBucket = modifyCompressedBucketRemoveLastInField(*compressedBucket, "time"_sd); |