Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ public GenericRow merge(GenericRow previousRecord, GenericRow newRecord) {
// comparison column values from the previous record, and the sole non-null comparison column value from
// the new record.
newRecord.putValue(column, previousRecord.getValue(column));
if (!_comparisonColumns.contains(column)) {
// Despite wanting to overwrite the values to comparison columns from prior records, we want to
// preserve for _this_ record which comparison column was non-null. Doing so will allow us to
// re-evaluate the same comparisons when reading a segment and during steady-state stream ingestion
newRecord.removeNullValueField(column);
}
newRecord.removeNullValueField(column);
} else if (!_comparisonColumns.contains(column)) {
PartialUpsertMerger merger = _column2Mergers.getOrDefault(column, _defaultPartialUpsertMerger);
newRecord.putValue(column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ private void testUpsertIngestion(UpsertConfig upsertConfig)
// Confirm that both comparison column values have made it into the persisted upserted doc
Assert.assertEquals(1567205397L, _mutableSegmentImpl.getValue(2, "secondsSinceEpoch"));
Assert.assertEquals(1567205395L, _mutableSegmentImpl.getValue(2, "otherComparisonColumn"));
Assert.assertTrue(_mutableSegmentImpl.getDataSource("secondsSinceEpoch").getNullValueVector().isNull(2));
Assert.assertFalse(_mutableSegmentImpl.getDataSource("secondsSinceEpoch").getNullValueVector().isNull(2));
Assert.assertFalse(_mutableSegmentImpl.getDataSource("otherComparisonColumn").getNullValueVector().isNull(2));

// bb
Assert.assertFalse(bitmap.contains(4));
Expand All @@ -149,6 +150,7 @@ private void testUpsertIngestion(UpsertConfig upsertConfig)
Assert.assertEquals(1567205396L, _mutableSegmentImpl.getValue(5, "secondsSinceEpoch"));
Assert.assertEquals(Long.MIN_VALUE, _mutableSegmentImpl.getValue(5, "otherComparisonColumn"));
Assert.assertTrue(_mutableSegmentImpl.getDataSource("otherComparisonColumn").getNullValueVector().isNull(5));
Assert.assertFalse(_mutableSegmentImpl.getDataSource("secondsSinceEpoch").getNullValueVector().isNull(5));
}
}
}