T-88: M1.1m — Security-master run composer: readers output + bar spans → Stage A → Stage B → Pass 6 → Pass 4 → match report + persist input (pure, in-memory, no new dependencies)
This commit is contained in:
parent
3bdf7a8da6
commit
8ccca45174
2 changed files with 23 additions and 10 deletions
|
|
@ -233,7 +233,7 @@ interface ExistingConflictRow {
|
|||
}
|
||||
|
||||
interface ExistingPass4ConflictRow {
|
||||
conflict_key: string;
|
||||
row_idx: number;
|
||||
}
|
||||
|
||||
interface PreparedInstrument {
|
||||
|
|
@ -1424,15 +1424,15 @@ async function persistWithinTransaction(
|
|||
const slice = pass4Conflicts.slice(offset, offset + chunkSize);
|
||||
const res = await client.query<ExistingPass4ConflictRow>(
|
||||
`SELECT DISTINCT
|
||||
u.conflict_key
|
||||
u.row_idx
|
||||
FROM resolution_conflict rc
|
||||
INNER JOIN UNNEST(
|
||||
$1::varchar[],
|
||||
$2::varchar[],
|
||||
$3::varchar[],
|
||||
$4::jsonb[],
|
||||
$5::text[]
|
||||
) AS u(source, source_id, conflict_kind, detail, conflict_key)
|
||||
$5::int4[]
|
||||
) AS u(source, source_id, conflict_kind, detail, row_idx)
|
||||
ON rc.source = u.source
|
||||
AND rc.source_id = u.source_id
|
||||
AND rc.conflict_kind = u.conflict_kind
|
||||
|
|
@ -1442,11 +1442,14 @@ async function persistWithinTransaction(
|
|||
slice.map(c => c.sourceId),
|
||||
slice.map(c => c.conflictKind),
|
||||
slice.map(c => c.detailJson),
|
||||
slice.map(c => c.key),
|
||||
slice.map((_, idx) => idx),
|
||||
]
|
||||
);
|
||||
for (const row of res.rows) {
|
||||
existingPass4ConflictKeys.add(row.conflict_key);
|
||||
const matched = slice[row.row_idx];
|
||||
if (matched !== undefined) {
|
||||
existingPass4ConflictKeys.add(matched.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue