Connectors / Files & object stores

Local files

source

Local file source; path/dir/glob/URL, every file format incl. Avro/ORC/Parquet, incremental by mtime or name

Install

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

Starter config

source:
  type: file
  config:
    path: ""    # REQUIRED — A file, a directory, a glob (`data/**/*.jsonl`), or one `http://` / `https://` URL.
    # format: null    # Which format a file is in: resolved from its extension (`auto`) or fixed.
    # compression: null    # User-facing compression config.
    # recursive: false    # Descend into subdirectories when `path` is a directory.
    # concurrency: 4    # Files opened ahead of the one being decoded (ordered prefetch).
    # batch_size: 1000    # Records per emitted page.
    # incremental: null    # Read only files that are new since the previous run.
    # stable_for_secs: 0    # Skip files modified less than this many seconds ago — files still being written.
    # strict: false    # Refuse (instead of skipping with a warning) a file whose extension names no format under `format: auto`.
    # max_object_bytes: 2147483648    # Largest file, once decompressed, that a format read whole (JSON array, XML, Excel, compressed or remote Avro/ORC/Parquet, encrypted files) may reach; a larger one fails with an error instead of exhausting memory.
    # max_decoded_bytes: 0    # Most bytes one object may decode to in memory where a format can expand past its input: an Avro file's records (per batch where the file streams), an Excel workbook's parts and shared strings.
    # max_files: 0    # Read at most this many files (after sorting and filtering).
    # headers: {}    # Request headers for an `http(s)://` path (e.g.
    # http_retries: 3    # Retries for a failed HTTP request (connection error, 429, 5xx), with exponential backoff that honours `Retry-After`.
    # http_connect_timeout_secs: 30    # Seconds to wait for an HTTP connection to open.
    # http_read_timeout_secs: 300    # Seconds an HTTP response may go without sending a byte — waiting for the headers or mid-body.
    # csv: { ... }    # CSV dialect.
    # excel: { ... }    # Excel worksheet selection.
    # xml: { ... }    # XML record framing.
    # avro: { ... }    # Avro read/write options.
    # orc: { ... }    # ORC read options.
    # parquet: { ... }    # Parquet reader options (the `parquet:` block of an object-store source).
    # encryption: null    # Decrypt files sealed by the file or jsonl sink's `encryption` block (AES-256-GCM).

Capabilities

Replay Non-deterministic replay
Exactly-once replay No
Incremental Yes
Dataset discovery Yes
Reports lag No
Compression Yes

Config fields

FieldTypeDefaultDescription
path
required
string — A file, a directory, a glob (data/**/*.jsonl), or one http:// / https:// URL. A directory lists its regular files (descending into subdirectories with recursive: true); every listing is sorted by path.
format object auto File format, auto (by extension, per file) by default. Under auto a file with no recognised extension is skipped with a warning, or refused when strict: true. JSON Lines, Avro, ORC and Parquet stream; JSON arrays, CSV, XML and Excel are read whole per file.
compression string | object auto Compression codec. auto (default) resolves per file from its suffix (.gz, .zst).
recursive boolean false Descend into subdirectories when path is a directory.
concurrency integer 4 Files opened ahead of the one being decoded (ordered prefetch). 0 reads serially.
batch_size integer 1000 Records per emitted page. 0 emits one page per file.
incremental object — Read only files that are new since the previous run. Needs a pipeline state: block; the bookmark is kept under file:<path>.
stable_for_secs integer — Skip files modified less than this many seconds ago — files still being written. They are read by a later run once they settle.
strict boolean false Refuse (instead of skipping with a warning) a file whose extension names no format under format: auto.
max_object_bytes integer 2147483648 Largest file, once decompressed, that a format read whole (JSON array, XML, Excel, compressed or remote Avro/ORC/Parquet, encrypted files) may reach; a larger one fails with an error instead of exhausting memory. Default 2 GiB.
max_decoded_bytes integer — Most bytes one object may decode to in memory where a format can expand past its input: an Avro file's records (per batch where the file streams), an Excel workbook's parts and shared strings. A file past it fails with an error instead of exhausting memory. Default 64 × max_object_bytes, at most 16 GiB.
max_files integer — Read at most this many files (after sorting and filtering).
headers object — Request headers for an http(s):// path (e.g. Authorization).
http_retries integer 3 Retries for a failed HTTP request (connection error, 429, 5xx), with exponential backoff that honours Retry-After.
http_connect_timeout_secs integer 30 Seconds to wait for an HTTP connection to open. A timeout is retried.
http_read_timeout_secs integer 300 Seconds an HTTP response may go without sending a byte — waiting for the headers or mid-body. A timeout before the body starts is retried; one mid-body fails the file.
csv object delimiter: ","has_headers: truequote: "on_unknown_field: widen CSV dialect, used for CSV files.
excel object header_row: 0 Worksheet selection, used for Excel files.
xml object record_element: recordroot_element: records Record framing, used for XML files.
avro object codec: null Reader schema, used for Avro files.
orc object {} Column projection, used for ORC files.
parquet object {} Column projection, used for Parquet files.
encryption object — Decrypt files sealed by the file or jsonl sink's encryption block (AES-256-GCM). An encrypted file is read into memory whole: JSON Lines and raw text written line by line are then opened one line at a time, every other file as one sealed body. A file that is not sealed fails the read.
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