-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GH-46462: [C++][Parquet] Expose currently thrown EncodedStatistics when checking is_stats_set #46463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
GH-46462: [C++][Parquet] Expose currently thrown EncodedStatistics when checking is_stats_set #46463
Changes from all commits
c755198
7758c39
3ada3bd
ed301a0
e50b010
c802ae7
15b4950
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,7 @@ class PARQUET_EXPORT ColumnChunkMetaData { | |
bool is_stats_set() const; | ||
bool is_geo_stats_set() const; | ||
std::shared_ptr<Statistics> statistics() const; | ||
std::shared_ptr<EncodedStatistics> encoded_statistics() const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just have a general question that when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I also wondering this... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can think of a couple of cases where this can be useful. For example if I am building a metadata inspection tool where I don't need the size_t total_size = 0;
for (int iter = 0; iter < 1000; ++iter) {
for (int r = 0; r < metadata->num_row_groups(); r++) {
const auto row_group = metadata->RowGroup(r);
for (int c = 0; c < metadata->num_columns(); c++) {
const auto stats = row_group->ColumnChunk(c)->statistics();
if (stats->HasMinMax()) {
const std::string& min_encoded = stats->EncodeMin();
const std::string& max_encoded = stats->EncodeMax();
total_size += min_encoded.size() + max_encoded.size();
}
}
}
} Having access to the @pitrou thoughts on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I agree that it can be beneficial, for example if one is only interested in the null count. Note that A separate improvement would be to make the construction of TypedStatistics faster, for example creating a decoder instance just to PLAIN-decode one value does not really make sense. But that's a bit orthogonal IMHO. |
||
std::shared_ptr<SizeStatistics> size_statistics() const; | ||
std::shared_ptr<geospatial::GeoStatistics> geo_statistics() const; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it is unnecessary to call
Encode()
every timeis_stats_set()
. Should we take a different approach by caching the result ofis_stats_set()
?IMO, many Parquet metadata objects are meant to access once and cache them for follow-up uses. For example,
FileMetaData
will always create newRowGroupMetaData
andColumnMetaData
objects so users are supposed to cache them to avoid creation cost.