github-actions[bot] commented on code in PR #66756:
URL: https://github.com/apache/doris/pull/66756#discussion_r3791889790


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ColStatsData.java:
##########
@@ -139,6 +139,10 @@ public String toSQL(boolean roundByParentheses) {
 
     public ColumnStatistic toColumnStatistic() {
         try {
+            if (!isValid()) {

Review Comment:
   [P2] Avoid overflow in the newly activated ratio check — This guard now 
applies `isValid()` to manual cache publication and persisted-row reloads, but 
its `ndv > 10 * count` (and later `nullCount * 10`) arithmetic is signed 
`long`. A valid supported row such as `row_count=1000000000000000000, ndv=1` 
makes `10 * count` wrap negative, so both the immediate cache and reload become 
UNKNOWN and SHOW hides the row; the internal statistics fields are BIGINT and 
ALTER STATS accepts these numeric inputs. Please express both factor-of-ten 
comparisons without integral multiplication overflow and cover values above 
`Long.MAX_VALUE / 10` through both conversion paths.



##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatistic.java:
##########
@@ -142,6 +142,11 @@ public static ColumnStatistic 
fromResultRowList(List<ResultRow> resultRows) {
      * this function is used by analyze job and cbo job.
      */
     public static ColumnStatistic fromResultRow(ResultRow row) {
+        ColStatsData statsData = new ColStatsData(row);
+        if (!statsData.isValid()) {

Review Comment:
   [P2] Keep retained invalid rows from flooding WARN on every read — 
`isValid()` logs on every false branch, so this new reader guard makes the 
intentionally persisted UNKNOWN representation noisy at every boundary: 
collection already validates and logs, `syncColStats` validates again, each 
follower validates again, and preheat/reload/refresh/SHOW repeat it for the 
retained row. Preheat alone can examine up to the default 500,000 cache 
entries. Please make the reader-side check quiet (or make validity testing 
side-effect-free) and emit the warning/metric once at the collection boundary.



-- 
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]

Reply via email to