feat(bigquery-driver): Add subdirectory support for export bucket #10291
+36
−4
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.
Description
Fixes #4252
This PR adds support for storing pre-aggregations in subdirectories within an export bucket for the BigQuery driver, enabling multi-tenant scenarios where each tenant can have isolated folders in a shared bucket.
Changes
exportBucketURL to extract bucket name and path using BaseDriver'sparseBucketUrl()methodexportBucketconfiguration (e.g.,gs://bucket/tenant-1)Implementation Details
Modified Files
packages/cubejs-bigquery-driver/src/BigQueryDriver.tsCode Changes
The implementation leverages BaseDriver's existing
parseBucketUrl()method (inherited from@cubejs-backend/base-driver) to parse bucket URLs and extract path components. This approach is consistent with how Snowflake and Databricks drivers handle bucket paths.Constructor change:
unload() method change:
Configuration Examples
Use Case: Multi-Tenant with IAM Isolation
This feature enables a shared bucket architecture where:
gs://shared-bucket/tenant-1/)Testing
The existing integration tests (
testUnload,testUnloadEscapeSymbol) already cover the unload functionality and will validate this change with real GCS buckets in the CI environment.Backward Compatibility
✅ Fully backward compatible - existing configurations without paths continue to work exactly as before. The change is purely additive.
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com