Skip to content

fix(warehouse): set explicit lineSep for deltalake csv copy - #7455

Merged
achettyiitr merged 4 commits into
release/1.89.xfrom
fix/deltalake-csv-linesep-1.89.x
Oct 7, 2026
Merged

achettyiitr merged 4 commits into
release/1.89.xfrom
fix/deltalake-csv-linesep-1.89.x

Conversation

@achettyiitr

@achettyiitr achettyiitr commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Description

Deltalake CSV loads can merge two rows into one when the first row in a load file has a quoted value containing \r\n.

COPY INTO reads our CSV load files with multiLine = 'true' but no lineSep. In that mode, Databricks guesses the line separator from the start of the file. If the first row has a quoted value with \r\n (e.g. raw SMTP bounce reasons from Braze users.messages.email.SoftBounce), it picks \r\n. The real \n row ends written by our Go CSV encoder are then read as data, and the next row's first column runs into the last column, uuid_ts:

  • ANSI mode on: CAST_INVALID_INPUT on uuid_ts (value <ts>\n<next row's anonymous_id>), and the table load is aborted. This is what Betashares hits on users_messages_email_soft_bounce (10 aborted uploads since Jul 5).
  • ANSI mode off: the load "succeeds", but uuid_ts is NULL and the merged row is lost without any error.

Our encoder always ends rows with \n, so this pins 'lineSep' = '\n' in both CSV FORMAT_OPTIONS blocks: the load COPY and the validation test-table COPY.

Parquet load files (Warehouse.deltalake.useParquetLoadFiles) are not affected.

Testing

Reproduced end-to-end in rudder-mini against the Databricks test warehouse (ANSI_MODE=false), sending a 2-event soft_bounce batch whose first event's bounce_reason contains \r\n:

build rows in Databricks uuid_ts \r\n in value
master d11977948 1 of 2 (second row merged into first and lost) NULL became \n
with this fix 2 of 2 populated kept as \r\n

Integration test: added TestIntegration/Load_Table/line_breaks_in_quoted_values. It's table-driven over two fixtures written with Go's encoding/csv, because Databricks auto-detects the separator from the first row:

  • testdata/crlf.csv.gz: row 1 has a quoted \r\n
  • testdata/cr.csv.gz: row 1 has a quoted lone \r

Both files also carry a quoted \n, embedded quotes, a comma, a leading space and a mixed value. The test asserts every stored value, then the row count.

crlf_in_first_row cr_in_first_row
SQL warehouse, with fix PASS PASS
SQL warehouse, pre-fix FAIL (6 of 7 rows lost) FAIL (6 of 7 rows lost)
All-purpose cluster + spark.sql.ansi.enabled=true, with fix PASS PASS
All-purpose cluster + spark.sql.ansi.enabled=true, pre-fix FAIL CAST_INVALID_INPUT (customer's error) FAIL CAST_INVALID_INPUT

The full Load_Table group passes with the fix on both the SQL warehouse and an all-purpose cluster.

CI: cherry-picked #7449 (ECR pull-through cache for openapi-generator), because the release branch still logs into Docker Hub with the expired DOCKERHUB_READONLY_TOKEN.

  • go build, go vet and go test -count 1 ./warehouse/integrations/deltalake/... pass

Linear Ticket

Resolves INT-7282

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

🤖 Generated with Claude Code

Databricks' CSV reader with multiLine=true and no lineSep auto-detects
the line separator from the start of the file. When the first row has a
quoted value containing \r\n (e.g. SMTP bounce reasons), it picks \r\n
and the real \n row terminators written by our CSV writer are treated as
data, merging rows. The last column (uuid_ts) then holds
"<ts>\n<next row's first column>", failing with CAST_INVALID_INPUT under
ANSI mode or silently loading NULL and dropping rows otherwise.

Our encoder always terminates rows with \n, so pin lineSep to \n for both
the load COPY and the validation test-table COPY.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
Add a Load Table case that loads a CSV whose first row has a quoted
\r\n value. Without an explicit lineSep, Databricks merges the rows
(1 of 3 inserted); with the fix all rows load with values intact.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.48%. Comparing base (88d0d52) to head (5b022e6).

Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.89.x    #7455      +/-   ##
==================================================
- Coverage           84.51%   84.48%   -0.03%     
==================================================
  Files                 622      622              
  Lines               62057    62059       +2     
==================================================
- Hits                52447    52431      -16     
- Misses               9607     9625      +18     
  Partials                3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

atzoum and others added 2 commits October 7, 2026 17:16
# Description

The `generate` job in `verify.yml` logged into Docker Hub with
`DOCKERHUB_READONLY_TOKEN` only to pull `openapi-generator-cli`. Now
that token has expired, the job fails on every PR. The job now logs into
ECR with the existing `AWS_ECR_READ_ONLY_IAM_ROLE_ARN` OIDC role and
pulls the image through the `docker-hub` pull-through cache, using a new
`DOCKER_HUB_PREFIX` make variable (empty by default, so local runs are
unchanged). This is the same change as rudder-ingestion-svc#709.

## Linear Ticket

n/a

## Security

- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 6e9f920)
…sv load

Make the line-break load test table-driven over two fixtures, since
Databricks auto-detects the line separator from the first row: one starts
with a quoted \r\n, the other with a lone \r. Both files also carry
quoted \n, embedded quotes, a comma, a leading space, and a mixed value.
Assert the stored records before the row count so a regression prints
the merged row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr merged commit 1c7dfc2 into release/1.89.x Oct 7, 2026
110 of 112 checks passed
@achettyiitr
achettyiitr deleted the fix/deltalake-csv-linesep-1.89.x branch October 7, 2026 12:33
achettyiitr pushed a commit that referenced this pull request Oct 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.89.2](v1.89.1...v1.89.2)
(2026-10-07)


### Bug Fixes

* **warehouse:** set explicit lineSep for deltalake csv copy
([#7455](#7455))
([1c7dfc2](1c7dfc2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
achettyiitr added a commit that referenced this pull request Oct 7, 2026
# Description

Syncing patch release v1.89.2 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix(warehouse): set explicit lineSep for deltalake csv copy (#7455)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Akash Chetty <[email protected]>
Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 12, 2026
mihir20 pushed a commit that referenced this pull request Oct 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.90.0-rc.1](v1.89.0...v1.90.0-rc.1)
(2026-10-12)


### Features

* **processor:** add source_out reporting metric
([#7435](#7435))
([909fba9](909fba9))
* **processor:** allow disabling event schemas v2 per source
([#7429](#7429))
([a8c12b2](a8c12b2))
* **processor:** report dest_transformer diff rows for multiplexing
destination transformations
([#7446](#7446))
([cd95c32](cd95c32))
* **processor:** report dest_transformer succeeded for destinations
without a destination transformation
([#7445](#7445))
([21f7e41](21f7e41))
* **processor:** report user_transformer succeeded for destinations
without a user transformation
([#7440](#7440))
([f424257](f424257))
* **router:** mask live events destination credentials
([#7460](#7460))
([5fa5fe2](5fa5fe2))
* **warehouse:** add Microsoft Fabric destination
([#7441](#7441))
([74940c2](74940c2))


### Bug Fixes

* **batchrouter:** do not abort warehouse jobs on a zero failure
timestamp
([#7426](#7426))
([506f6d5](506f6d5))
* **batchrouter:** recover snowpipe streaming channels for tables
dropped externally
([#7434](#7434))
([93cd81d](93cd81d))
* **destination:** encode Lytics bulk upload URL values
([#7433](#7433))
([08e6937](08e6937))
* **destination:** retry bqstream transport failures
([#7464](#7464))
([cd3dc3e](cd3dc3e))
* **warehouse:** cap deltalake validation schema describes
([#7444](#7444))
([d119779](d119779))
* **warehouse:** keep snowflake copy credentials out of logs
([#7442](#7442))
([f91747b](f91747b))
* **warehouse:** set explicit lineSep for deltalake csv copy
([#7455](#7455))
([cc22d18](cc22d18))


### Miscellaneous

* migrate self-hosted arm64 docker build runners to gha-runner-scale-set
([#7425](#7425))
([5cdffde](5cdffde))
* **processor:** retire the destination-filter reorder, dedup and
gw_ingested reporting flags
([#7450](#7450))
([1040511](1040511))
* pull openapi-generator through the ECR pull-through cache
([#7449](#7449))
([6e9f920](6e9f920))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
mihir20 pushed a commit that referenced this pull request Oct 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.90.0](v1.89.0...v1.90.0)
(2026-10-12)


### Features

* **processor:** add source_out reporting metric
([#7435](#7435))
([909fba9](909fba9))
* **processor:** allow disabling event schemas v2 per source
([#7429](#7429))
([a8c12b2](a8c12b2))
* **processor:** report dest_transformer diff rows for multiplexing
destination transformations
([#7446](#7446))
([cd95c32](cd95c32))
* **processor:** report dest_transformer succeeded for destinations
without a destination transformation
([#7445](#7445))
([21f7e41](21f7e41))
* **processor:** report user_transformer succeeded for destinations
without a user transformation
([#7440](#7440))
([f424257](f424257))
* **router:** mask live events destination credentials
([#7460](#7460))
([5fa5fe2](5fa5fe2))
* **warehouse:** add Microsoft Fabric destination
([#7441](#7441))
([74940c2](74940c2))


### Bug Fixes

* **batchrouter:** do not abort warehouse jobs on a zero failure
timestamp
([#7426](#7426))
([506f6d5](506f6d5))
* **batchrouter:** recover snowpipe streaming channels for tables
dropped externally
([#7434](#7434))
([93cd81d](93cd81d))
* **destination:** encode Lytics bulk upload URL values
([#7433](#7433))
([08e6937](08e6937))
* **destination:** retry bqstream transport failures
([#7464](#7464))
([cd3dc3e](cd3dc3e))
* **warehouse:** cap deltalake validation schema describes
([#7444](#7444))
([d119779](d119779))
* **warehouse:** keep snowflake copy credentials out of logs
([#7442](#7442))
([f91747b](f91747b))
* **warehouse:** set explicit lineSep for deltalake csv copy
([#7455](#7455))
([cc22d18](cc22d18))


### Miscellaneous

* migrate self-hosted arm64 docker build runners to gha-runner-scale-set
([#7425](#7425))
([5cdffde](5cdffde))
* **processor:** retire the destination-filter reorder, dedup and
gw_ingested reporting flags
([#7450](#7450))
([1040511](1040511))
* pull openapi-generator through the ECR pull-through cache
([#7449](#7449))
([6e9f920](6e9f920))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants