From 71034da3127f786348696304ae26c89988946220 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 18 Aug 2026 23:48:22 -0400 Subject: [PATCH] Always sync unposted rprh batches NWPDAT stays 0001-01-01 until a batch posts, so the watermark branch alone can never see an in-flight batch -- it only appears once posting stamps a real date. Only 4 rows are unposted, so the whole set now comes over every run. Found by reconcile: dest and source tied on count but five numeric sums differed, which resolved to a single row pair -- an unposted batch missing from the dest, and one stale row for a batch purged upstream (deleted separately, since delete-by-key cannot remove it). The resolver still has no lookback, so a back-dated post below the high-water stays invisible; posting stamps the current date, so this only matters for a genuinely back-dated one. Co-Authored-By: Claude Opus 5 --- config/modules/rprh.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/modules/rprh.sql b/config/modules/rprh.sql index 456b1a4..c4accb9 100644 --- a/config/modules/rprh.sql +++ b/config/modules/rprh.sql @@ -53,4 +53,8 @@ SELECT NWPDAT AS nwpdat, NWPTIM AS nwptim FROM LGDAT.RPRH +-- NWPDAT is 0001-01-01 until the batch posts, so the watermark branch alone can +-- never see an in-flight batch -- it only appears once posting stamps a real +-- date. Only 4 rows are unposted, so the whole set comes over every run. WHERE NWPDAT >= DATE('{stamp}') + OR RTRIM(NWPOST) <> 'Y'