Jackie-Jiang commented on code in PR #18496:
URL: https://github.com/apache/pinot/pull/18496#discussion_r3243273664


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandler.java:
##########
@@ -144,6 +142,11 @@ public void updateIndices(SegmentDirectory.Writer 
segmentWriter)
       String column = entry.getKey();
       List<Operation> operations = entry.getValue();
 
+      // Backfill missing 1.6.0-era stats for this column before dispatching 
ops so the per-op handlers can read
+      // them off `ColumnMetadata` when they construct their forward-index 
creator. No-op when the column is
+      // fixed-width, already has the stats, or has no forward index on disk.
+      backfillMissingStats(column, segmentWriter);

Review Comment:
   Intentional — the contract is to backfill whenever any forward-index change 
is being made for the column, regardless of whether the immediate op consumes 
the stats. The cost of one column scan on a legacy var-length 
`DISABLE_FORWARD_INDEX` is bounded by the column size, and the persisted stats 
remain useful for any future operation (re-enable, query-time access via 
`ColumnMetadata`). A precise gate would have to encode the per-op rewrite-path 
matrix, which is more code than the simple invariant is worth.



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