Skip to content

Commit ed5e186

Browse files
committed
Implement PartitionClause::modify_schema in the same way as the others
1 parent 1b63ab0 commit ed5e186

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cpp/arcticdb/processing/clause.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ struct PartitionClause {
273273
}
274274

275275
OutputSchema modify_schema(OutputSchema&& output_schema) const {
276-
// TODO: Factor out checking against clause_info_.input_columns_ into separate function and call from all clauses
277-
// TODO: Consider adding (optional, lazily constructed?) unordered map from column names to data types in
278-
// output_schema to make this sort of operation more efficient
279-
schema::check<ErrorCode::E_COLUMN_DOESNT_EXIST>(
280-
output_schema.stream_descriptor_.find_field(grouping_column_).has_value(),
281-
"GroupByClause requires column '{}' to exist in input data",
282-
grouping_column_
283-
);
276+
const auto& column_types = output_schema.column_types();
277+
for (const auto& input_column: *clause_info_.input_columns_) {
278+
schema::check<ErrorCode::E_COLUMN_DOESNT_EXIST>(
279+
column_types.contains(input_column),
280+
"GroupByClause requires column '{}' to exist in input data",
281+
grouping_column_
282+
);
283+
}
284284
return output_schema;
285285
}
286286

0 commit comments

Comments
 (0)