feat(bigquery-driver): Add subdirectory support for export bucket#10291
Open
pnedelko wants to merge 4 commits intocube-js:masterfrom
Open
feat(bigquery-driver): Add subdirectory support for export bucket#10291pnedelko wants to merge 4 commits intocube-js:masterfrom
pnedelko wants to merge 4 commits intocube-js:masterfrom
Conversation
Fixes cube-js#4252 This change enables 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: - Parse exportBucket URL to extract bucket name and path using BaseDriver's parseBucketUrl() method - Support paths in exportBucket configuration (e.g., gs://bucket/tenant-1) - Use extracted path as prefix when creating and listing unload files - Maintain full backward compatibility with existing configurations Configuration examples: - gs://my-bucket -> files at bucket root (backward compatible) - gs://my-bucket/tenant-1 -> files in tenant-1/ subdirectory - gs://my-bucket/data/exports/tenant-1 -> multi-level paths supported 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The parseBucketUrl tests were testing BaseDriver's implementation, not BigQueryDriver-specific functionality. The existing integration tests already cover the unload functionality adequately.
Add documentation for the new subdirectory feature in CUBEJS_DB_EXPORT_BUCKET, including: - Updated environment variable description in the table - New section explaining subdirectory configuration - Examples for single-level and multi-level paths - Multi-tenant use case with IAM permissions
Author
|
Works on my PC 😉 |
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.
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