Skip to content

Commit b9b1a76

Browse files
committed
Added test case
1 parent d8675f7 commit b9b1a76

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

document-store/src/integrationTest/java/org/hypertrace/core/documentstore/DocStoreQueryV1Test.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6275,6 +6275,27 @@ void testSearchWithNullFilterEmptySelectionsNoOrderBy(String dataStoreName) {
62756275
}
62766276
assertEquals(5, count);
62776277
}
6278+
6279+
@ParameterizedTest
6280+
@ArgumentsSource(PostgresProvider.class)
6281+
void testSearchWithUnknownFieldFallback(String dataStoreName) {
6282+
Collection flatCollection = getFlatCollection(dataStoreName);
6283+
6284+
org.hypertrace.core.documentstore.Query legacyQuery =
6285+
new org.hypertrace.core.documentstore.Query()
6286+
.withSelection("nonexistent_field")
6287+
.withOrderBy(new OrderBy("another_unknown", true))
6288+
.withLimit(1);
6289+
6290+
assertThrows(
6291+
Exception.class,
6292+
() -> {
6293+
Iterator<Document> results = flatCollection.search(legacyQuery);
6294+
while (results.hasNext()) {
6295+
results.next();
6296+
}
6297+
});
6298+
}
62786299
}
62796300

62806301
@Nested

0 commit comments

Comments
 (0)