Copilot commented on code in PR #873:
URL: https://github.com/apache/iceberg-cpp/pull/873#discussion_r3725948393
##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -894,74 +1040,29 @@ Result<std::vector<ManifestEntry>>
ManifestReaderImpl::ReadEntries(bool only_liv
ICEBERG_RETURN_UNEXPECTED(OpenReader(std::move(projected_data_file_schema)));
ICEBERG_DCHECK(file_reader_ != nullptr, "File reader should be initialized");
- std::vector<ManifestEntry> manifest_entries;
ICEBERG_ASSIGN_OR_RAISE(auto arrow_schema, file_reader_->Schema());
internal::ArrowSchemaGuard schema_guard(&arrow_schema);
// Get evaluators if needed
- Evaluator* evaluator = nullptr;
- InclusiveMetricsEvaluator* metrics_evaluator = nullptr;
+ std::unique_ptr<Evaluator> evaluator;
+ std::unique_ptr<InclusiveMetricsEvaluator> metrics_evaluator;
if (HasPartitionFilter() || HasRowFilter()) {
- ICEBERG_ASSIGN_OR_RAISE(evaluator, GetEvaluator());
+ ICEBERG_ASSIGN_OR_RAISE(std::ignore, GetEvaluator());
+ evaluator = std::move(evaluator_);
}
if (HasRowFilter()) {
- ICEBERG_ASSIGN_OR_RAISE(metrics_evaluator, GetMetricsEvaluator());
+ ICEBERG_ASSIGN_OR_RAISE(std::ignore, GetMetricsEvaluator());
Review Comment:
ICEBERG_ASSIGN_OR_RAISE(std::ignore, ...) relies on std::ignore (a <tuple>
facility) being available via transitive includes, which is not guaranteed and
can break builds. Prefer propagating errors without std::ignore and then moving
the cached unique_ptrs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]