saurabhd336 commented on code in PR #8708:
URL: https://github.com/apache/pinot/pull/8708#discussion_r887554894


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/mutable/MutableSegmentImpl.java:
##########
@@ -477,8 +482,22 @@ public boolean index(GenericRow row, @Nullable RowMetadata 
rowMetadata)
       throws IOException {
     boolean canTakeMore;
     int numDocsIndexed = _numDocsIndexed;
+
+    RecordInfo recordInfo = null;
+
+    if (isDedupEnabled() || isUpsertEnabled()) {
+      recordInfo = getRecordInfo(row, numDocsIndexed);
+    }
+
+    if (isDedupEnabled() && 
_partitionDedupMetadataManager.checkRecordPresentOrUpdate(recordInfo, this)) {
+      _logger.info("Dropped row {} since its primary key already exists", row);
+      if (_serverMetrics != null) {
+        _serverMetrics.addMeteredTableValue(_realtimeTableName, 
ServerMeter.REALTIME_DEDUP_DROPPED, 1);
+      }
+      return numDocsIndexed < _capacity;

Review Comment:
   Ack



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to