Connectors / Files & object stores

Google Cloud Storage

sink

Google Cloud Storage sink — JSONL files

Install

cargo install faucet-cli --features sink-gcs
faucet init --sink gcs
# Cargo.toml — use it as a library
cargo add faucet-sink-gcs

Starter config

sink:
  type: gcs
  config:
    bucket: ""    # REQUIRED — GCS bucket name.
    # prefix: ""    # Object-name prefix for written files.
    # path: ""    # Object key template inside the bucket, after `prefix` — the file sink's `path` (#777).
    # if_exists: null    # What happens when a file this run writes already exists (`if_exists`).
    # write_mode: null    # Pipeline-level write mode (`write_mode`).
    # format: null    # On-the-wire format of objects written by the GCS sink.
    # auth: { type: service_account_json_file }    # one of: service_account_json_file, service_account_json_inline, application_default, anonymous
      # --- Alternative variants — replace the block above with one of these ---
      # type: service_account_json_inline
      # config:
        # json: ""    # REQUIRED
      #
      # type: application_default
      #
      # type: anonymous
    # file_extension: ".jsonl"    # File extension for written objects (default `.jsonl`).
    # max_records_per_file: 0    # Hard cap on records per uploaded object.
    # max_bytes_per_file: 0    # Maximum **bytes** per object before rolling to a new one (#618).
    # concurrency: 10    # Maximum number of uploads in flight (default 10): a page that rolls into several objects uploads them concurrently while the next object is encoded.
    # batch_size: 1000    # Records per object when `max_records_per_file` is not set (without `path`).
    # storage_host: ""    # Optional storage-host override (integration-test escape hatch).
    # compression: null    # User-facing compression config.
    # csv: { ... }    # CSV dialect.
    # excel: { ... }    # Excel worksheet selection.
    # xml: { ... }    # XML record framing.
    # avro: { ... }    # Avro read/write options.
    # parquet: { ... }    # Parquet write options.
    # json_lines: { ... }    # JSON Lines write options.
    # encryption: null    # Encrypt objects at rest (#777; the `encryption` feature).
    # scratch_dir: ""    # Directory the sink builds each object in before uploading it (default: the system temporary directory).

Capabilities

Delivery At-least-once
Write modes append, overwrite
Exactly-once writes No
Schema evolution No
Scoped cleanup No
Staged bulk load No
Run rollback No
Compression Yes

Config fields

FieldTypeDefaultDescription
bucket
required
string — GCS bucket name.
prefix string "" Object-name prefix for written files.
path string — Object key template inside the bucket, after prefix — the file sink's path (#777). May contain {part} (numbered objects) and ${now.*} tokens; a trailing / is a directory of part-{part}<extension> objects. When set, file_extension is not used. Unset: every run writes new objects named <prefix><run id>-<part><file_extension> (<run id> is a fresh time-ordered UUID, <part> is 00001, 00002, …).
if_exists object replace What to do when an object of the same name already exists (if_exists): replace it (default), append to it (JSON Lines, CSV, raw text) or fail with error (#777). Needs path. mode is accepted as another name for this key, and overwrite / error_if_exists for its values.
write_mode object append append (default) or overwrite: write the run's objects into a hidden swap area and move them into place only after a successful run, then remove objects of an earlier run that match path and were not rewritten (#777). The move is one object at a time, so a reader listing the destination while it runs can see new objects beside old ones; a move that was interrupted is finished by the next run. Needs path.
format object json_lines Object format (default: json_lines). Set to parquet (with the arrow feature) to write Parquet objects and enable the columnar fast path.
auth object type: application_default Credential source.
file_extension string .jsonl File extension for written objects (default .jsonl).
max_records_per_file integer — Hard cap on records per uploaded object. None leaves the cap to batch_size.
max_bytes_per_file integer — Maximum **bytes** per object before rolling to a new one (#618).
concurrency integer 10 Maximum number of uploads in flight (default 10): a page that rolls into several objects uploads them concurrently while the next object is encoded. flush returns only after every upload has landed.
batch_size integer 1000 Records per object when max_records_per_file is not set (without path). Records accumulate across write_batch calls and an object closes once it holds this many records, or at flush. batch_size = 0 is the "no re-chunking" sentinel: no record cap, so JSON Lines and the whole-object formats write one object per flush, and Parquet one object per write_batch call. Ignored when path is set.
storage_host string — Optional storage-host override (integration-test escape hatch).
compression string | object auto Compression codec applied to each uploaded object body. Defaults to CompressionConfig::Auto — resolves against the object name (path's, else file_extension, so .jsonl.gz triggers gzip). Requires the crate-local compression feature. Note: this sink does **not** set the GCS Content-Encoding metadata, so consumers must decompress explicitly.
csv object delimiter: ","has_headers: truequote: "on_unknown_field: widen CSV dialect, used when format: csv (#604).
excel object header_row: 0 Worksheet name, used when format: xlsx (#604).
xml object record_element: recordroot_element: records Record framing, used when format: xml (#604).
avro object codec: null Writer schema and block codec, used when format: avro (#719).
parquet object row_group_size: 1048576 Parquet writer options, used when format: parquet (#777): compression (default zstd), row_group_size, explicit schema.
json_lines object pretty: false JSON Lines writer options (pretty), used when format: json_lines.
encryption object — Encrypt objects at rest (#777; the encryption feature). Scratch files are not encrypted while the run is in progress; those holding plaintext are kept in a private directory.
scratch_dir string — Directory the sink builds each object in before uploading it (default: the system temporary directory). JSON Lines and raw text need scratch space for the whole object; every other format needs room for each object being built (up to concurrency of them while uploads are in flight). A private subdirectory is created in it for each sink.
Get started

Your first pipeline runs in five minutes.

Install the CLI, scaffold a config, and move real data — nothing external to stand up.

curl -LsSf https://github.com/faucet-hq/faucet-stream/releases/latest/download/faucet-cli-installer.sh | sh
brew install faucet-hq/faucet-stream/faucet-cli