xiangfu0 commented on code in PR #20261:
URL: https://github.com/apache/pinot/pull/20261#discussion_r4570850683


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/merger/PartialUpsertColumnarMerger.java:
##########
@@ -70,9 +70,15 @@ public void merge(LazyRow previousRow, GenericRow newRow, 
Map<String, Object> re
       PartialUpsertColumnMerger merger = _column2Mergers.getOrDefault(column, 
_defaultColumnValueMerger);
       if (merger instanceof ForceOverwriteMerger) {
         // Force Overwrite mergers
-        // If the merge strategy is Force Overwrite merger and prevValue is 
always overwritten by newValue
-        Object prevValue = previousRow.getValue(column);
-        resultHolder.put(column, merger.merge(prevValue, 
newRow.getValue(column)));
+        // If the merge strategy is Force Overwrite merger and prevValue is 
always overwritten by newValue.
+        // A null newValue is stored in the row as the column's default value, 
so put null here to keep the
+        // column null instead of turning the default value into a real value.
+        if (newRow.isNullValue(column)) {
+          resultHolder.put(column, null);

Review Comment:
   **[MAJOR] Reproduced: this replaces the valid time placeholder with the raw 
schema default.**
   
   Trigger: `comparisonColumns: ["version"]`, the time column under 
FORCE_OVERWRITE (per column or as the default strategy), and a record with no 
time value. `NullValueTransformer` stores a valid timestamp, and this line 
makes the handler swap it for the table schema's default. That default is 
`Long.MIN_VALUE` for a LONG millis column and `"null"` for a STRING `yyyyMMdd` 
column. The base code kept the valid timestamp.
   
   Those values then become the time column's min/max. With the default 
`segmentTimeValueCheck=true` and `continueOnError=false`, `BaseSegmentCreator` 
throws and the segment cannot commit.
   
   Suggested fix: leave the incoming row untouched for FORCE_OVERWRITE 
(`continue`). Locally that keeps the valid timestamp and its null mark, and all 
9 `PartialUpsertHandlerTest` cases still pass. Please add a regression test 
with separate time and comparison columns.



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