Skip to content

Commit

Permalink
Update test cases in FDBSimpleQueryGraphTest to cover cases alleged…
Browse files Browse the repository at this point in the history
… in issue FoundationDB#2880
  • Loading branch information
alecgrieser committed Aug 16, 2024
1 parent 3b19996 commit 72b1c32
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ public WithSelectCompensation derivedWithPredicateCompensationMap(final boolean
@Nonnull final Set<? extends Quantifier> unmatchedQuantifiers,
@Nonnull final Set<CorrelationIdentifier> compensatedAliases,
@Nonnull final Optional<Value> remainingComputationValueOptional) {
Verify.verify(!predicateCompensationMap.isEmpty() || remainingComputationValueOptional.isPresent());
Verify.verify(!predicateCompensationMap.isEmpty() || !unmatchedQuantifiers.isEmpty() || remainingComputationValueOptional.isPresent());
return new ForMatch(isImpossible, childCompensation, predicateCompensationMap, matchedQuantifiers, unmatchedQuantifiers, compensatedAliases, remainingComputationValueOptional);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,23 @@ protected RecordMetaDataHook complexQuerySetupHook() {
};
}

protected void openHierarchicalRecordStore(FDBRecordContext context) throws Exception {
protected void openHierarchicalRecordStore(FDBRecordContext context) {
RecordMetaDataBuilder metaDataBuilder = RecordMetaData.newBuilder().setRecords(TestRecords3Proto.getDescriptor());
metaDataBuilder.addUniversalIndex(globalCountIndex());
metaDataBuilder.getRecordType("MyHierarchicalRecord").setPrimaryKey(
concatenateFields("parent_path", "child_name"));
createOrOpenRecordStore(context, metaDataBuilder.getRecordMetaData());
}

protected void openNestedRecordStore(FDBRecordContext context) throws Exception {
protected void openNestedRecordStore(FDBRecordContext context) {
openNestedRecordStore(context, null);
}

protected void openNestedRecordStore(FDBRecordContext context, @Nullable RecordMetaDataHook hook) throws Exception {
protected void openNestedRecordStore(FDBRecordContext context, @Nullable RecordMetaDataHook hook) {
createOrOpenRecordStore(context, nestedMetaData(hook));
}

protected void openNestedWrappedArrayRecordStore(@Nonnull FDBRecordContext context) throws Exception {
protected void openNestedWrappedArrayRecordStore(@Nonnull FDBRecordContext context, @Nullable RecordMetaDataHook hook) {
RecordMetaDataBuilder metaDataBuilder = RecordMetaData.newBuilder().setRecords(TestRecords4WrapperProto.getDescriptor());
metaDataBuilder.addUniversalIndex(globalCountIndex());
metaDataBuilder.addIndex("RestaurantRecord", "review_rating", field("reviews", FanType.None).nest(field("values", FanType.FanOut).nest("rating")));
Expand All @@ -312,6 +312,9 @@ protected void openNestedWrappedArrayRecordStore(@Nonnull FDBRecordContext conte
metaDataBuilder.addIndex("RestaurantRecord", "customers", field("customer", FanType.None).nest(field("values", FanType.FanOut)));
metaDataBuilder.addIndex("RestaurantRecord", "customers-name", concat(field("customer", FanType.None).nest(field("values", FanType.FanOut)), field("name")));
metaDataBuilder.addIndex("RestaurantReviewer", "stats$school", field("stats").nest(field("start_date")));
if (hook != null) {
hook.apply(metaDataBuilder);
}
createOrOpenRecordStore(context, metaDataBuilder.getRecordMetaData());
}

Expand Down
Loading

0 comments on commit 72b1c32

Please sign in to comment.