Skip to content

feat(warehouse): add maxcompute destination - #7568

Merged
ItsSudip merged 45 commits into
masterfrom
harness/INT-7506-feat-warehouse-add-partial-maxc-3e323871
Nov 6, 2026
Merged

ItsSudip merged 45 commits into
masterfrom
harness/INT-7506-feat-warehouse-add-partial-maxc-3e323871

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add the MAXCOMPUTE warehouse destination with the Alibaba ODPS Go SDK v0.4.26 and customer-owned Alibaba OSS. This implements the server scope of INT-7506 against the MaxCompute LLD.

Design

  • Register MaxCompute across warehouse routing, validation, JSON load files, manager factories and the integration matrix. The rudder-go-kit pin includes the released ALIBABA_OSS provider.
  • Support exclusive AccessKey and RAM role modes. Validate the region-bound ODPS endpoint before attaching credentials; derive the role ExternalId from the trusted workspace ID. OSS upload uses the access role; ODPS LOAD receives the read role only as odps.properties.rolearn.
  • Create append Delta tables with TIMESTAMP columns and immutable auto-partition expressions. New tables use pipeline-aware partitionColumn/partitionType; catalog metadata governs existing tables. Ingestion partitions use TRUNC_TIME(uuid_ts, ...).
  • Load gzipped JSON from one OSS folder per generated load-file group, after checking every file's location and SQL literal safety. LOAD rows come from the task summary; an unavailable summary reports an unknown count without retrying a committed append.
  • Load identifies before users. Users carry-forward uses an unpartitioned append Delta staging table, as BigQuery does, and restricts target history to staging IDs and a bounded pt window. Reconcile deduplicating views before each table load from the upload's warehouse schema, falling back to the catalog, which can lag a newly created schema or table. The validation test load skips the view refresh because its throwaway table gets its view at creation.
  • The directoryPath setting holds the OSS bucket, optionally followed by a directory prefix (bucket/path). The Alibaba OSS config conversion splits it into the bucket and the staging prefix, so the connection test, uploads and LOAD all stage under that directory.
  • Guard ODPS credential refresh, bound job polling, sanitize SDK diagnostics, classify actionable validation failures (including oss_access_denied when the OSS policy denies the bucket or its folder path), enforce identifier and column limits before DDL, and log auth mode, validation outcomes and table LOAD counts using existing warehouse metrics and labels.
  • Restore RUDDER_TMPDIR temp files and the generic upload/download validation path for every warehouse. The shared-code footprint follows the existing BigQuery and Fabric pattern.

Verification

  • Unit and focused package tests cover ODPS/OSS auth, SQL and load checks, partition metadata, users, views, error mappings, identifier/column limits, reserved keywords and the bucket folder-path split.
  • The MaxCompute integration test (validation steps, JSON event and discard flows, users carry-forward, view schema changes, partitioning, and negative object-storage cases in AccessKey and role modes) is registered in the warehouse-integration matrix and skipped in this PR.
  • Run locally against a live MaxCompute project with directoryPath set to bucket/folder and an OSS policy scoped to that folder, the validation cases passed in AccessKey and role modes, and an incorrect AccessKey secret, an incorrect role ExternalId and a folder outside the policy were rejected at the object-storage step (access_key_authentication, role_assumption, oss_access_denied).
  • make fmt and go build -mod=readonly ./warehouse/... passed.
  • go test -count=1 passed for utils/misc and warehouse/integrations/maxcompute.
  • Scoped golangci-lint reported 0 issues. The commit's Gitleaks scan reported no leaks found.

Known limitations

  • The first version does not support native JSON, jsonPaths, MERGE, identity resolution or Stream Tunnel streaming.
  • RudderStack reads use a bounded 60-day pt window. A LOAD task summary that cannot be parsed leaves the inserted-row count unknown; it does not fail an already committed LOAD.
  • MaxCompute account setup, project membership, schema enablement, V2 type edition and OSS role grants must be configured by the customer. The integrations-config definition and enablement flag roll out separately after this server PR.

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from task INT-7506.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

Comment thread warehouse/validations/validate.go Fixed
@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

CI lint failed on two forbidigo findings: errors.As in maxcompute.go and json.Marshal in users_test.go. The generated-files job failed because make fmt rewrote the usersUploader literal in users_test.go. I replaced the forbidden calls with errors.AsType and jsonrs.Marshal, then committed the required formatting.

make fmt, the MaxCompute package tests, and golangci-lint (0 issues) passed. The broader local make lint stopped at gitleaks on 34 findings in an older ancestor commit; none is in this fix.

e37a4e3

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I found no PR code failure to fix in this run. Snowflake’s TestIntegration/Event_flow/Upload_Job_with_Key_Pair_Unencrypted_Key failed under the race detector: both conflicting accesses are in gosnowflake/[email protected] at transport.go:188. That dependency version is unchanged from master. BigQuery’s TestBQStreamAllEvents/table_does_not_exists failed when the BigQuery service returned googleapi: Error 400 ... jobBackendError while reading query results; the service response says retrying may solve it. The All job failed only because those two test jobs failed.

These are upstream driver and service failures, so I made no repository change. The PR branch remains at e37a4e32d7b233686d072baef96dcaf20a4a0a23.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.70281% with 427 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.35%. Comparing base (895367e) to head (35015a0).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
warehouse/integrations/maxcompute/maxcompute.go 53.38% 227 Missing ⚠️
warehouse/integrations/maxcompute/client/odps.go 62.62% 74 Missing ⚠️
warehouse/integrations/maxcompute/load.go 77.06% 25 Missing ⚠️
...integrations/maxcompute/client/odps_credentials.go 52.77% 17 Missing ⚠️
warehouse/integrations/maxcompute/partition.go 73.33% 16 Missing ⚠️
warehouse/integrations/maxcompute/schema.go 73.33% 16 Missing ⚠️
warehouse/slave/worker.go 6.25% 15 Missing ⚠️
warehouse/integrations/maxcompute/users.go 82.71% 14 Missing ⚠️
warehouse/integrations/maxcompute/view.go 84.31% 8 Missing ⚠️
warehouse/encoding/jsonloader.go 25.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7568      +/-   ##
==========================================
- Coverage   85.24%   84.35%   -0.90%     
==========================================
  Files         631      640       +9     
  Lines       62979    64246    +1267     
==========================================
+ Hits        53689    54196     +507     
- Misses       9287    10047     +760     
  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.

Comment thread warehouse/validations/validate.go Fixed
Comment thread warehouse/validations/validate.go Fixed
@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

The tracing failure was a port collision: CI showed the transformer using 127.0.0.1:36375, then the gateway failed to bind :36375, and TestTracing/multiplexing_in_processor_transformations timed out. I moved gateway port selection after the test HTTP servers start. The focused tracing subtest passes; golangci-lint reports 0 issues, while the full lint command still stops on 34 pre-existing gitleaks findings.

The separate Snowflake job still hits a data race in unchanged gosnowflake/[email protected] transportFactory.createTransport code. The All job reflects those failed jobs; the Snowflake race needs an upstream driver fix.

7422a8d

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

The ARM64 image build failed before compilation: go mod download received HTTP/2 INTERNAL_ERROR while fetching two Databricks binding ZIPs from proxy.golang.org. I retried the failed jobs; attempt 2 completed successfully, including the ARM64 build and image manifest. No source change was needed.

Comment thread warehouse/validations/validate.go Fixed
Comment thread warehouse/validations/validate.go Fixed
Comment thread warehouse/validations/validate.go Fixed
@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

The Snowflake job failed in TestIntegration/Event_flow/Upload_Job because concurrent connections raced in gosnowflake/[email protected]/transport.go:188 while it rewrote a shared HTTP transport. All only reflected that job failure. I bumped sqlconnect-go from v1.36.0 to v1.37.1, whose released Snowflake fix prevents the driver from mutating that transport.

Offline Snowflake tests, the warehouse build, formatting, and golangci-lint pass. The live Snowflake suite needs CI credentials; make lint still stops at 34 pre-existing gitleaks findings.

1eadf1c

@rudder-devbox

rudder-devbox Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

…cket name

The MaxCompute bucket name may now carry a folder path (bucket/path). The Alibaba OSS config conversion splits it into the bucket and the staging prefix, so the connection test, uploads and LOAD all use the folder without a separate prefix setting.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…ation

Move the ODPS SDK wrapper from warehouse/client to warehouse/integrations/maxcompute/client, drop the ODPS prefix from its names and remove test-only constructors. warehouse/client keeps the ODPS field and a Query hook for the admin query tool, as it does for BigQuery.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
Copilot AI balanced review requested due to automatic review settings November 6, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the OSS bucket and optional directory prefix from the directoryPath setting. When the users INSERT has committed, a failed staging-table DROP is logged instead of failing the load, so a retry cannot append the same users again. A timestamp partition column resolves to _timestamp or, when reserved-keyword escaping is skipped, timestamp. Helper aliases in the users carry-forward and view SQL avoid the table's column names.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
Copilot AI balanced review requested due to automatic review settings November 6, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread utils/misc/misc.go Resolved
Comment thread utils/misc/misc.go Resolved
The OSS conversion no longer sets endPoint and useInternalEndpoint, which decode to the same zero values, and the ODPS client no longer sets request timeouts that the manager's connectionTimeout overrides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.28.0
Copilot AI balanced review requested due to automatic review settings November 6, 2026 13:14
@ItsSudip
ItsSudip requested a review from achettyiitr November 6, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because a later folder LOAD failure can leave earlier folders committed, causing table-level retries to duplicate rows.

2 open issues

Review effort: Balanced

@ItsSudip
ItsSudip merged commit a64bfd9 into master Nov 6, 2026
76 checks passed
@ItsSudip
ItsSudip deleted the harness/INT-7506-feat-warehouse-add-partial-maxc-3e323871 branch November 6, 2026 17:05
atzoum pushed a commit that referenced this pull request Nov 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.93.0-rc.1](v1.92.0...v1.93.0-rc.1)
(2026-11-09)


### Features

* **destination:** recognize machine_oauth accounts as oauth
([#7549](#7549))
([f51e4ca](f51e4ca))
* incremental definitions on the v2 namespace config
([#7487](#7487))
([ce51e38](ce51e38))
* **processor:** add flag to abort python transformations on deployments
that do not offer them
([#7571](#7571))
([ca85eb2](ca85eb2))
* **processor:** filter http v2 events by destination message types
([#7538](#7538))
([58fd176](58fd176))
* **processor:** send the workspace id to per-workspace pyt pods
([#7551](#7551))
([ea33835](ea33835))
* **warehouse:** add maxcompute destination
([#7568](#7568))
([a64bfd9](a64bfd9))


### Bug Fixes

* **batchrouter:** abort bq stream all events jobs on terminal auth
failures
([#7548](#7548))
([6b7e023](6b7e023))
* bump andybalholm/brotli to v1.2.7 [SEC-759]
([#7525](#7525))
([6dfe468](6dfe468))
* bump rudder-go-kit to v0.84.3
([#7547](#7547))
([355054a](355054a))
* **core:** schema forwarder panics on shutdown
([#7519](#7519))
([dd61cfc](dd61cfc))
* database connections hang when context is cancelled during a copy
([#7578](#7578))
([8dae6e3](8dae6e3))
* **jobsdb:** compaction missing pairs after one that doesn't fit
([#7574](#7574))
([573271b](573271b))
* **jobsdb:** multiconsumer recovery misses a consumer's executing
status after another consumer's later status
([#7554](#7554))
([69b43e0](69b43e0))
* **jobsdb:** old jobs not expiring for every consumer
([#7573](#7573))
([366f114](366f114))
* **jobsdb:** pickups stalling on status tables with skewed stats
([#7572](#7572))
([318446f](318446f))
* **jobsdb:** unionjobsdb functions pick the first datasets by table
name ([#7558](#7558))
([e94d6c5](e94d6c5))
* **router:** event order test only counts drained jobs of the last
dataset
([#7552](#7552))
([b0a097a](b0a097a))
* **router:** mask secrets in array-shaped reporting samples
([#7536](#7536))
([902160f](902160f))
* **warehouse:** hot-reload degraded workspaces without aborting
restored uploads
([#7564](#7564))
([cb98598](cb98598))
* **warehouse:** match deltalake columns case-insensitively
([#7563](#7563))
([a7d30d7](a7d30d7))
* **warehouse:** migrate snowflake to gosnowflake v2.3.0
([#7542](#7542))
([cc09426](cc09426))
* **warehouse:** skip job-creation error log on router shutdown
([#7567](#7567))
([895367e](895367e))


### Miscellaneous

* **deps:** bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6
([#7545](#7545))
([35ee952](35ee952))
* export only the +Inf bucket for limiter timers
([#7570](#7570))
([4429472](4429472))
* **router:** add drainReason label to pipeline_processed_events
([#7561](#7561))
([af0aef8](af0aef8))
* sync release v1.92.0 to main branch
([#7534](#7534))
([9ab165d](9ab165d))
* **warehouse:** bump sqlconnect-go to v1.37.1
([#7575](#7575))
([acdad67](acdad67))

---
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>
atzoum pushed a commit that referenced this pull request Nov 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.93.0](v1.92.0...v1.93.0)
(2026-11-09)


### Features

* **destination:** recognize machine_oauth accounts as oauth
([#7549](#7549))
([f51e4ca](f51e4ca))
* incremental definitions on the v2 namespace config
([#7487](#7487))
([ce51e38](ce51e38))
* **processor:** add flag to abort python transformations on deployments
that do not offer them
([#7571](#7571))
([ca85eb2](ca85eb2))
* **processor:** filter http v2 events by destination message types
([#7538](#7538))
([58fd176](58fd176))
* **processor:** send the workspace id to per-workspace pyt pods
([#7551](#7551))
([ea33835](ea33835))
* **warehouse:** add maxcompute destination
([#7568](#7568))
([a64bfd9](a64bfd9))


### Bug Fixes

* **batchrouter:** abort bq stream all events jobs on terminal auth
failures
([#7548](#7548))
([6b7e023](6b7e023))
* bump andybalholm/brotli to v1.2.7 [SEC-759]
([#7525](#7525))
([6dfe468](6dfe468))
* bump rudder-go-kit to v0.84.3
([#7547](#7547))
([355054a](355054a))
* **core:** schema forwarder panics on shutdown
([#7519](#7519))
([dd61cfc](dd61cfc))
* database connections hang when context is cancelled during a copy
([#7578](#7578))
([8dae6e3](8dae6e3))
* **jobsdb:** compaction missing pairs after one that doesn't fit
([#7574](#7574))
([573271b](573271b))
* **jobsdb:** multiconsumer recovery misses a consumer's executing
status after another consumer's later status
([#7554](#7554))
([69b43e0](69b43e0))
* **jobsdb:** old jobs not expiring for every consumer
([#7573](#7573))
([366f114](366f114))
* **jobsdb:** pickups stalling on status tables with skewed stats
([#7572](#7572))
([318446f](318446f))
* **jobsdb:** unionjobsdb functions pick the first datasets by table
name ([#7558](#7558))
([e94d6c5](e94d6c5))
* **router:** event order test only counts drained jobs of the last
dataset
([#7552](#7552))
([b0a097a](b0a097a))
* **router:** mask secrets in array-shaped reporting samples
([#7536](#7536))
([902160f](902160f))
* **warehouse:** hot-reload degraded workspaces without aborting
restored uploads
([#7564](#7564))
([cb98598](cb98598))
* **warehouse:** match deltalake columns case-insensitively
([#7563](#7563))
([a7d30d7](a7d30d7))
* **warehouse:** migrate snowflake to gosnowflake v2.3.0
([#7542](#7542))
([cc09426](cc09426))
* **warehouse:** skip job-creation error log on router shutdown
([#7567](#7567))
([895367e](895367e))


### Miscellaneous

* **deps:** bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6
([#7545](#7545))
([35ee952](35ee952))
* export only the +Inf bucket for limiter timers
([#7570](#7570))
([4429472](4429472))
* **router:** add drainReason label to pipeline_processed_events
([#7561](#7561))
([af0aef8](af0aef8))
* sync release v1.92.0 to main branch
([#7534](#7534))
([9ab165d](9ab165d))
* **warehouse:** bump sqlconnect-go to v1.37.1
([#7575](#7575))
([acdad67](acdad67))

---
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.

5 participants