You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/06/18 16:19:40 UTC
[PR] Fix table scan schema cache invalidation [iceberg-cpp]
fallintoplace opened a new pull request, #758:
URL: https://github.com/apache/iceberg-cpp/pull/758
## Summary
- invalidate the cached scan snapshot schema whenever snapshot/ref/time-travel state changes
- preserve requested column-stat names and re-resolve them during Build so stats IDs match the final snapshot schema
- add regression coverage for IncludeColumnStats before UseSnapshot and non-main UseRef with an evolved schema
## Tests
- cmake --build build --target scan_test
- ctest --test-dir build -R scan_test --output-on-failure
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: invalidate table scan schema cache [iceberg-cpp]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac merged PR #758:
URL: https://github.com/apache/iceberg-cpp/pull/758
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: invalidate table scan schema cache [iceberg-cpp]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on PR #758:
URL: https://github.com/apache/iceberg-cpp/pull/758#issuecomment-4823921049
Thank you, @fallintoplace!
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix: invalidate table scan schema cache [iceberg-cpp]
Posted by "wgtmac (via GitHub)" <gi...@apache.org>.
wgtmac commented on code in PR #758:
URL: https://github.com/apache/iceberg-cpp/pull/758#discussion_r3486381973
##########
src/iceberg/table_scan.cc:
##########
@@ -239,24 +239,17 @@ TableScanBuilder<ScanType>& TableScanBuilder<ScanType>::CaseSensitive(
template <typename ScanType>
TableScanBuilder<ScanType>& TableScanBuilder<ScanType>::IncludeColumnStats() {
context_.return_column_stats = true;
+ context_.columns_to_keep_stats.clear();
+ requested_column_stats_.reset();
return *this;
}
template <typename ScanType>
TableScanBuilder<ScanType>& TableScanBuilder<ScanType>::IncludeColumnStats(
const std::vector<std::string>& requested_columns) {
context_.return_column_stats = true;
- context_.columns_to_keep_stats.clear();
- context_.columns_to_keep_stats.reserve(requested_columns.size());
-
- ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto schema_ref, ResolveSnapshotSchema());
- const auto& schema = schema_ref.get();
- for (const auto& column_name : requested_columns) {
- ICEBERG_BUILDER_ASSIGN_OR_RETURN(auto field, schema->FindFieldByName(column_name));
- if (field.has_value()) {
- context_.columns_to_keep_stats.insert(field.value().get().field_id());
- }
- }
+ requested_column_stats_ = requested_columns;
+ ICEBERG_BUILDER_RETURN_IF_ERROR(ResolveColumnStatsSelection());
Review Comment:
Could we avoid eager schema resolution here? If `IncludeColumnStats(requested_columns)` only stores the requested names, and `Build()` resolves them against the final snapshot schema, then we don't need to remember to call `InvalidateSnapshotSchema()` in every snapshot/ref setter. That seems simpler and less error-prone.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org