Skip to content

Commit 2caf381

Browse files
committed
fix: use correct outcome format for empty/fallback partition results
The partitioned diff returned `{ Match: { row_count: 0, algorithm: 'partitioned' } }` when no partition values were found or all partitions failed. This format lacks `mode: 'diff'`, so `formatOutcome` fell through to raw JSON.stringify instead of producing clean output. Use the standard Rust engine format: `{ mode: 'diff', stats: {...}, diff_rows: [] }`
1 parent 7402408 commit 2caf381

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • packages/opencode/src/altimate/native/connections

packages/opencode/src/altimate/native/connections/data-diff.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,10 @@ async function runPartitionedDiff(params: DataDiffParams): Promise<DataDiffResul
646646
}
647647

648648
if (partitionValues.length === 0) {
649-
return { success: true, steps: 1, outcome: { Match: { row_count: 0, algorithm: "partitioned" } }, partition_results: [] }
649+
return {
650+
success: true, steps: 1, partition_results: [],
651+
outcome: { mode: "diff", stats: { rows_table1: 0, rows_table2: 0, exclusive_table1: 0, exclusive_table2: 0, updated: 0, unchanged: 0 }, diff_rows: [] },
652+
}
650653
}
651654

652655
// Diff each partition
@@ -685,7 +688,7 @@ async function runPartitionedDiff(params: DataDiffParams): Promise<DataDiffResul
685688
return {
686689
success: true,
687690
steps: totalSteps,
688-
outcome: aggregatedOutcome ?? { Match: { row_count: 0, algorithm: "partitioned" } },
691+
outcome: aggregatedOutcome ?? { mode: "diff", stats: { rows_table1: 0, rows_table2: 0, exclusive_table1: 0, exclusive_table2: 0, updated: 0, unchanged: 0 }, diff_rows: [] },
689692
partition_results: partitionResults,
690693
}
691694
}

0 commit comments

Comments
 (0)