Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.Advanced TutorialsBuild end-to-end workflows between two specific systems.API ReferenceCLI ReferenceRelease Notes
Version: 2.0.2

Local File System

The Local File System connector lets Tabsdata read files from and write files to the server's own filesystem.

The LocalFileSrc connector can be used by a publisher function to read data from local files into a Tabsdata table.

The LocalFileDest connector can be used by a subscriber function to write data from a Tabsdata table into local files.

Supported formats​

FormatPublishSubscribe
AUTOYesYes
CSVYesYes
JSONYesYes
AVROYesYes
PARQUETYesYes
LOGYesNo

Publisher​

The LocalFileSrc connector can be used by a publisher function to read data from local files into a Tabsdata table. See the full publisher walkthrough

Connection​

Local File System publishers use LocalFileSrcConn to define the root filesystem path used by the publisher. Unlike the cloud storage connectors, there is no bucket and no credentials: the connector reads directly off the server's own disk.

conn-local.yaml
kind: connectionDef
apiVersion: '1.0'
type: tabsdatak.conn.localfile:LocalFileSrcConn
spec:
base_path: '/data/hr'
  • required
  • optional

Connection Config Parameters​

base_path​

The absolute filesystem path that acts as the root for all paths the publisher reads. Unlike the cloud storage connectors, base_path is required here: there is no bucket to fall back on, so the server needs a starting point on disk.

conn_cfg​

Optional connector configuration overrides.

Publisher​

Configure LocalFileSrc as the source of a publisher function to select the files that Tabsdata reads from disk.

publish_orders.py
from tabsdatak.api import publisher
from tabsdatak.conn.localfile import LocalFileSrc, SrcFileFormat

@publisher(
source=LocalFileSrc(
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 disk.

Each path is relative to the base_path configured in LocalFileSrcConn. Source paths:

  • cannot begin or end with /
  • cannot contain empty path segments
  • can contain a * glob in the final path segment

For example:

LocalFileSrc(
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:

OptionDescription
tabsdata.file.chunk_sizeControls the size of chunks used when reading files.
tabsdata.src_metadata.dropWhen True, excludes the @td.file.path metadata column.

By default, rows read from disk include a @td.file.path metadata column containing the source file's path.

Subscriber​

The LocalFileDest connector can be used by a subscriber function to write data from a Tabsdata table into local files. See the full subscriber walkthrough

Connection​

Local File System subscribers use LocalFileDestConn to define the root filesystem path used by the subscriber. Unlike the cloud storage connectors, there is no bucket and no credentials: the connector writes directly onto the server's own disk.

conn-local.yaml
kind: connectionDef
apiVersion: '1.0'
type: tabsdatak.conn.localfile:LocalFileDestConn
spec:
base_path: '/data/exports'
  • required
  • optional

Connection Config Parameters​

base_path​

The absolute filesystem path that acts as the root for all paths the subscriber writes. Unlike the cloud storage connectors, base_path is required here: there is no bucket to fall back on, so the server needs a starting point on disk.

conn_cfg​

Optional connector configuration overrides.

Subscriber​

Configure LocalFileDest as the destination of a subscriber function to define where Tabsdata writes files on disk.

write_orders.py
from tabsdatak.api import subscriber
from tabsdatak.conn.localfile import LocalFileDest, DestFileFormat

@subscriber(
destination=LocalFileDest(
paths=[
"exports/orders.parquet",
],
),
input_tables=["orders"],
)
def write_orders(orders):
return orders
  • required
  • optional
  • optional
  • optional

Function Config Parameters​

paths​

Defines where the subscriber writes files on disk.

Each path is relative to the base_path configured in LocalFileDestConn. Destination paths:

  • cannot begin or end with /
  • cannot contain empty path segments
  • cannot contain globs

Each element in paths represents one destination slot and maps positionally to a value returned by the subscriber function.

Destination paths can contain variables that Tabsdata substitutes when the subscriber runs:

VariableValue
${EXEC_PLAN_ID}Current execution plan ID.
${TRX_ID}Current transaction ID.
${EXEC_PLAN_TS}Timestamp when the execution plan started.

For example:

LocalFileDest(
paths=[
"exports/${EXEC_PLAN_ID}/orders.parquet",
]
)

Dynamic paths can be used to create a new file for each execution instead of overwriting an existing one.

format​

Sets the format used to write the destination file.

Supported formats are AUTO, CSV, JSON, AVRO, and PARQUET. The default is AUTO, which determines the format from the destination file extension.

format_cfg​

Sets format-specific writer options. Configuration is keyed by DestFileFormat.

dest_cfg​

Sets additional destination configuration.

The tabsdata.file.chunk_size option controls the size of chunks used when writing files.