Skip to content

Commit

Permalink
fix: bug when filtering for indexedStringColumns which are not presen…
Browse files Browse the repository at this point in the history
…t in some partitions
  • Loading branch information
Taepper committed Oct 26, 2023
1 parent 8ed14c3 commit 62d4e08
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions endToEndTests/test/queries/divisionFilter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"testCaseName": "Filter by division then aggregate",
"query": {
"action": {
"limit": 100,
"type": "Aggregated"
},
"filterExpression": {
"children": [
{
"column": "division",
"value": "Aargau",
"type": "StringEquals"
}
],
"type": "And"
}
},
"expectedQueryResult": [
{
"count": 6
}
]
}
2 changes: 1 addition & 1 deletion src/silo/storage/column/indexed_string_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IndexedStringColumnPartition::IndexedStringColumnPartition(
std::optional<const roaring::Roaring*> IndexedStringColumnPartition::filter(const std::string& value
) const {
const auto value_id = lookup.getId(value);
if (value_id.has_value()) {
if (value_id.has_value() && indexed_values.contains(value_id.value())) {
return &indexed_values.at(value_id.value());
}
return std::nullopt;
Expand Down

0 comments on commit 62d4e08

Please sign in to comment.