Google Cloud Storage
The Google Cloud Storage connector lets Tabsdata read files from and write files to Google Cloud Storage.
The GCSSrc connector can be used by a publisher function to read data from Google Cloud Storage into a Tabsdata table.
The GCSDest connector can be used by a subscriber function to write data from a Tabsdata table into Google Cloud Storage.
Supported formats
| Format | Publish | Subscribe |
|---|---|---|
AUTO | Yes | Yes |
CSV | Yes | Yes |
JSON | Yes | Yes |
AVRO | Yes | Yes |
PARQUET | Yes | Yes |
LOG | Yes | No |
Publishers and Subscribers
The GCSSrc connector can be used by a publisher function to read data from Google Cloud Storage into a Tabsdata table. See the full publisher walkthrough
Connection
Google Cloud Storage publishers use GCSSrcConn to define the bucket and credentials used by the publisher.
kind: connectionDef
apiVersion: '1.0'
type: tabsdatak.conn.gcs:GCSSrcConn
spec:
bucket: 'acme-ingest'
credentials:
kind: gcpJsonCredentials
apiVersion: '1.0'
type: tabsdatak.conn.common.types:GCPJson
spec:
json: 'secret:{"type":"service_account",...}'
- required
- required
- optional
- optional
- optional
Connection Config Parameters
bucket
The name of the GCS bucket that contains the files to publish.
credentials
The service-account JSON credential used to access the bucket. GCPJson requires a json key holding the full service-account key document.
project
Optional GCP project id associated with the bucket.
base_path
Sets the base path within the bucket. All paths configured in GCSSrc are relative to this path.
base_path starts with /, cannot end with /, and cannot contain empty path segments. The default is /.
conn_cfg
Optional connector configuration overrides.
Publisher
Configure GCSSrc as the source of a publisher function to select the files that Tabsdata reads from Google Cloud Storage.
from tabsdatak.api import publisher
from tabsdatak.conn.gcs import GCSSrc, SrcFileFormat
@publisher(
source=GCSSrc(
paths=[
"incoming/orders.parquet",
],
),
output_tables=["orders"],
)
def publish_orders(orders):
return orders
- required
- optional
- optional
- optional
- optional
Function Config Parameters
paths
Defines the files that the publisher reads from Google Cloud Storage.
Each path is relative to the base_path configured in GCSSrcConn. Source paths:
- cannot begin or end with
/ - cannot contain empty path segments
- can contain a
*glob in the final path segment
For example:
GCSSrc(
paths=[
"orders/2026/*.parquet",
"customers/customers.csv",
]
)
Each element in paths represents one source slot and maps positionally to an argument in the publisher function.
When a path uses a glob to match multiple files, the matching files are provided through the corresponding publisher input.
format
Sets the format used to read the source files.
Supported formats are AUTO, CSV, JSON, AVRO, PARQUET, and LOG. The default is AUTO, which determines the format from the file extension.
format_cfg
Sets format-specific reader options. Configuration is keyed by SrcFileFormat.
initial_last_modified
Sets the initial cutoff for incremental ingestion.
On the first run, Tabsdata imports files modified at or after the specified timestamp. The cutoff then advances so subsequent runs only import newer files.
src_cfg
Sets additional source configuration.
The following options are supported:
| Option | Description |
|---|---|
tabsdata.file.chunk_size | Controls the size of chunks used when reading files. |
tabsdata.src_metadata.drop | When True, excludes the @td.file.path metadata column. |
By default, rows read from Google Cloud Storage include a @td.file.path metadata column containing the source file's URI.