-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[core] Introduce stats in snapshot #2677
Conversation
@@ -184,7 +192,8 @@ public Snapshot( | |||
@Nullable Long totalRecordCount, | |||
@Nullable Long deltaRecordCount, | |||
@Nullable Long changelogRecordCount, | |||
@Nullable Long watermark) { | |||
@Nullable Long watermark, | |||
@Nullable String statistics) { |
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.
If the partition-level statistics are supported, how to retrieve those?
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.
Plan to add a new field named partitionStatistics
(a manifestList link) when going to support partition-level statistics
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.
both statistics
and partitionStatistics
are related to statistics, why we split into two?
paimon-core/src/main/java/org/apache/paimon/stats/ColStats.java
Outdated
Show resolved
Hide resolved
paimon-core/src/main/java/org/apache/paimon/stats/ColStats.java
Outdated
Show resolved
Hide resolved
import java.io.UncheckedIOException; | ||
|
||
/** Stats file contains stats. */ | ||
public class StatsFile { |
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.
According to OOP, these methods(read
, write
, delete
and exists
) should not be the members of StatsFile
.
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.
just follow the implement of indexFile
and indexFileHandle
In pip-14, we included statistics for maxLen and avgLen, would you consider adding minLen? |
The primary purpose of PIP-14 is to enable Paimon to preserve stats for query engine CBO (especially for Spark), Below are the stats collected by various engines, the common ones among them are the stats introduced in this PIP. Hive: https://cwiki.apache.org/confluence/display/Hive/StatsDev Besides, from what I know, aside from histograms (maybe will add to paimon in the future), distinctCount, min, max, avglen, and nullCount are useful in cost estimation, maxLen is hardly used in Spark(open source)'s CBO. Nevertheless, we have decided to include it in order to maintain consistency with Spark. Of course, if we find other certain stats are very useful, we can also add them. Cost estimation example: https://cwiki.apache.org/confluence/display/Hive/Cost-based+optimization+in+Hive. |
Thanks for your reply, which helped me understand the design idea of this part. |
two update:
|
+1 |
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.
+1
Purpose
First step of PIP-14: Paimon statistics
snapshot-x
statistics/stats-87effd5d-48fd-4aab-81fe-4222b847d247-0
Tests
API and Format
write
read
Next
Future work