Repository navigation
Conversation
Found running a 2,500-row PostgreSQL <-> MySQL migration through the engine; each finished `succeeded` with wrong data. - Aggregate and Deduplicate answered per batch, so 1,000-row batches gave three partial rows per group and kept duplicates across batches. Transforms can now opt in to a session the executor ends after the sources finish, in pipeline order (also wired through dry runs). - Aggregate sums decimals exactly and compares min/max numerically; `numeric` arrives as text and was ranked and summed as text/floats. - SQL query/write read with per-query driver options: dates and timestamps keep their exact text as SqlTemporal values (still a Date to other drivers), MySQL gets instants in UTC rather than host local time, and MySQL BIGINT past 2^53 is read as a string. - Redact PII reaches dot paths and hashes objects by content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 102a69c5-7461-4ee2-b308-80f0f43dfd01) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
I ran real ETL and migration workflows through the engine against the dev Postgres 16 and MySQL 8.4 containers: a 2,500-row table copied Postgres → MySQL → Postgres, then Aggregate, Deduplicate and Redact over it. Four problems changed or lost data while the run still reported
succeeded:max(amount)=997.4760(true max12345678901235.8023); sums like461188.2134999999GROUP BY.123456→.123; bigint9007199254740995→…996;03:04 UTCstored as20:04(the engine host's local time)contact.emailWhat changed
TransformPipegains an optionalsession(context)withpush(batch)/end()(registry/pipes.ts).endafter the sources finish, in topological order, so a session's output reaches any session below it before that one ends.transform()still answers a single batch, for previews.exact-number.ts): a sum is a number when one holds it exactly, otherwise the exact digits. Min and max compare numbers numerically.keep: firsthands records on immediately.keep: lastholds one record per key until the input ends; superseded records go torejectsright away.faithfulQuery, which sets driver options per query and never changes a driver's global parsers. Nothing changes in thedbsubmodule.DATE/DATETIME/TIMESTAMP, becomeSqlTemporalvalues (temporal-values.ts). Each is still aDateto other drivers, templates and scripts, and also carries the exact text the database sent.supportBigNumbers, so aBIGINTpast 2^53 is read as a string.'…+00'). It would also have broken dates going into Oracle and SQL Server, hence theDatesubclass.contact.email); a key that itself contains a dot wins over the path. Objects are hashed and masked from their JSON instead of from[object Object].docs/guides/workflow.md(and its palette names, which didn't match),docs/releases/UNRELEASED.md.Behaviour changes
timestamptzis now read in Postgres's own session time zone, where before it used the engine host's.Tests
whole-input-transforms.test.ts(runs throughPipelineExecutorwith a batched source) andsql-driver-values.test.ts.main; the other three cover the new number helpers and behaviourmainalready had.npm run verifyhere: typecheck, unit, lint, build and deps-scan pass.npm audit signaturesfails locally on the knowntinybenchattestation registry error. CI's audit job passes onmain, and both vulnerability audits found 0.Not in this PR (found in the same review)
created_atand missing columns to existing tables.🤖 Generated with Claude Code
Note
High Risk
Touches core pipeline execution, cross-database SQL read/write semantics, and transform output timing—bugs could silently corrupt migrations/aggregations while runs still succeed.
Overview
Fixes workflow transforms and SQL pipes that reported succeeded but produced wrong data on batched ETL (e.g. 2,500-row Postgres ↔ MySQL migrations).
Whole-input transforms.
TransformPipegains optionalTransformSession(push/end). The executor routes every inbound batch through one session per pipe, then callsendin pipeline order after sources finish; dry-run records session output the same way. Aggregate and Deduplicate use this so grouping and dedupe span all SQL batches (not per 1,000-row chunk). Aggregate keeps running totals per group with exact decimal sums and numeric min/max (exact-number.ts). Dedupekeep: firststreams;keep: lastemits atend.SQL fidelity. SQL query/write paths use
faithfulQuerywith per-query Postgres/MySQL options (no global parser changes). Dates/timestamps becomeSqlTemporal(still aDateelsewhere) preserving DB text; MySQL gets UTC instants,supportBigNumbersfor BIGINT past 2^53.Redact PII. Dot paths (
contact.email), literal keys with dots win, objects hashed via JSON not[object Object].Docs updated in
workflow.mdandUNRELEASED.md; new integration tests (whole-input-transforms.test.ts,sql-driver-values.test.ts).Reviewed by Cursor Bugbot for commit fb2efe5. Bugbot is set up for automated code reviews on this repo. Configure here.