zhjwpku commented on code in PR #435:
URL: https://github.com/apache/iceberg-cpp/pull/435#discussion_r2648373102
##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -557,9 +558,9 @@ Result<std::vector<ManifestEntry>> ParseManifestEntry(
return manifest_entries;
}
-const std::vector<std::string> kStatsColumns = {"value_counts",
"null_value_counts",
- "nan_value_counts",
"lower_bounds",
- "upper_bounds",
"record_count"};
+const std::vector<std::string> kStatsColumns = {
+ "value_counts", "null_value_counts", "nan_value_counts", "lower_bounds",
+ "upper_bounds", "column_sizes", "record_count"};
Review Comment:
The newly added `column_sizes` seems not aligned with java impl, is that a
bug in java or our implementation is different?
##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -592,6 +593,29 @@ Result<std::shared_ptr<Schema>>
ProjectSchema(std::shared_ptr<Schema> schema,
} // namespace
+bool ManifestReader::ShouldDropStats(const std::vector<std::string>& columns) {
+ // Make sure we only drop all stats if we had projected all stats.
+ // We do not drop stats even if we had partially added some stats columns,
except for
+ // record_count column.
+ // Since we don't want to keep stats map which could be huge in size just
because we
+ // select record_count, which is a primitive type.
+ if (!columns.empty()) {
+ const std::unordered_set<std::string_view> selected(columns.cbegin(),
columns.cend());
+ if (selected.contains(ManifestReader::kAllColumns)) {
Review Comment:
```suggestion
if (selected.contains(Schema::kAllColumns)) {
```
--
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]