Google Cloud Storage
Google Cloud Storage is Google Cloud's object storage service, commonly used for data exports, backups and files shared between systems. With Weld you can load CSV, JSON and Parquet files from a Google Cloud Storage bucket into your data warehouse as tables, and keep them up to date as new files arrive.
Features
| Feature name | Supported | |
|---|---|---|
| Column Hashing | True | Column level |
| Blocking | True | Column level |
| Incremental | True | Append |
| Custom data | True | |
| History | False | |
| ReSync | True | Table level |
| Templates | False |
Supported file types
| File type |
|---|
| CSV |
| JSON (newline) |
| JSON (array) |
| Parquet |
Setup Guide - ELT
Prerequisites
- A Google Cloud Storage bucket containing files in one of the supported file types.
- Permission to manage access on that bucket in the Google Cloud console (for example the Storage Admin role), so you can give Weld read access.
Weld only reads from your bucket — it never writes, moves or deletes files.
Weld can access your bucket in one of two ways. Pick the one that suits your organisation:
- Grant access to a Weld service account — Weld provides a service account for your workspace and you grant it access to the bucket. No keys leave your Google Cloud project.
- Upload your own service account key — you create a service account in your own Google Cloud project and upload its JSON key to Weld.
Step 1 - Create the connection
- In the Weld app, navigate to Connections and click + New Connection.
- Search for Google Cloud Storage and select it.
- Choose how Weld should access the bucket and follow the matching option below.
Option A - Grant access to a Weld service account
- Select Grant access to a Weld service account.
- Enter the Bucket Name — just the name, without
gs://. - Click Connect.
- Weld shows the email of your workspace's Weld service account as Service Account Email at the top of the sync settings (Step 2). Copy it.
- In the Google Cloud console, open Cloud Storage → Buckets and click your bucket.
- Go to the Permissions tab and click Grant access.
- Paste the Weld service account email under New principals.
- Under Assign roles, select Cloud Storage → Storage Object Viewer.
- Click Save.
Weld cannot read the bucket until you have granted the role. If the folder list is empty or the file preview shows an error when you configure the sync, check that the Weld service account has Storage Object Viewer on the bucket.
One service account for your whole workspace
Weld uses the same service account for all Google Cloud Storage connections in your Weld workspace. You grant it access once per bucket. If you add another connection to a bucket you have already granted, you don't need to change anything in Google Cloud. For a different bucket, grant the same email access to that bucket.
A service account supports up to 10 connections. Once all 10 are in use, Weld adds a second service account for your workspace, with a different email, and so on. Always check the Service Account Email shown for each new connection. If it is one you haven't seen before, grant it access to the bucket as well. Deleting a connection frees up its place, and that place is reused first. A workspace can have up to 100 connections that use Weld service accounts. Beyond that, use Option B.
Option B - Upload your own service account key
First create a service account and key in your Google Cloud project:
- In the Google Cloud console, go to IAM & Admin → Service Accounts and click Create service account.
- Give it a name such as
weld-gcs-readerand click Create and continue, then Done. You do not need to grant it any project-level roles. - Open Cloud Storage → Buckets, click your bucket, go to the Permissions tab and click Grant access.
- Enter the service account's email under New principals, select the Storage Object Viewer role and click Save.
- Back in Service Accounts, click the service account, open the Keys tab and choose Add key → Create new key.
- Select JSON and click Create. The key file downloads to your computer.
Some organisations block service account key creation with the iam.disableServiceAccountKeyCreation organisation policy. If Create new key is unavailable, use Option A instead.
Then in Weld:
- Select Upload your own service account key.
- Upload the JSON key file under Service Account Key.
- Enter the Bucket Name — just the name, without
gs://. - Click Connect. Weld checks that it can list the bucket with the key, so the role must already be granted.
Step 2 - Data to sync
Each sync loads files from one folder of the bucket into one table. To load several kinds of files into separate tables, create a sync for each folder.
- Table name — the name of the destination table. If left empty, the bucket name is used, with dots and hyphens replaced by underscores.
- File type — CSV, Parquet, ndjson (newline-delimited JSON) or json_array.
- Is headerless CSV files — tick this if your CSV files have no header row. Columns are then named
field1,field2and so on. - Folder — the folder to read files from. The list shows up to 100 sub-folders; if yours is not listed, start typing its path. Choose
/for the bucket root. - File pattern — optionally, a regular expression that file names must match, for example
.*\.csv$ororders_\d{8}\.csv. - Files matching setup shows a preview of up to 10 files that match your settings. Use it to check the folder and pattern before continuing.
The table's columns are taken from the most recently modified matching file. Column names have spaces replaced by underscores and other special characters removed. Weld also adds two columns to every row:
filename— the path of the file the row came from.file_last_modified— when that file was last modified in the bucket.
Step 3 - Configure sync
- Select how often you would like the data to sync.
- Provide a destination schema name.
- Click Start Sync.
The first sync loads every file that matches your settings. After that, each sync loads only files that are new or have been modified since the previous sync, and appends their rows to the table.
- If you overwrite a file that Weld has already loaded, its rows are loaded again — the earlier rows stay in the table. Use the
filenameandfile_last_modifiedcolumns to keep only the latest version of each file. - Deleting a file from the bucket does not remove its rows from the table. Run a full sync of the table to rebuild it from the files currently in the bucket.