Start with four pinned order_id values. Read them in row order and remember which keys have already appeared.
The output keeps the original rows and adds order_id_duplicate. This is a validation check, not a deduplication step.
Checking whether a pinned key column is unique by adding a validation flag without dropping or changing rows.
highlighted = computed this step
Input key column
Start with 4 rows and one order_id column.
order id column
Row-by-row key check
Read rows in order: the first repeated key is OK, and the second repeated key is duplicate.
first seen versus duplicate
Add duplicate flag
Keep every row unchanged and add order_id_duplicate.