File System Destinations
File system destinations write files to local disk, SFTP, OneDrive, or SharePoint, one output per write target.
Providers: local | sftp | onedrive | sharepoint
Output fields
Every output in this type carries these fields; provider and format values live under options.
| Field | Type | Default | Notes |
|---|---|---|---|
name (required) | string | - | - |
from (required) | string | - | - |
format (required) | csv or json or orc or parquet or text or avro or excel | - | Explicit file format. If omitted, inferred from files_pattern extension. |
mode (required) | overwrite or append | - | - |
path (required) | string | - | - |
partitioning | object | - | Defines the partitioning strategy for file system destinations. |
Minimal example
A complete file_system destination with one output, written for provider local:
Code
Providers
local
An example for provider local:
Code
Connection
Use settings.connection_name for a saved connection, or configure it inline:
| Field | Type | Default | Notes |
|---|---|---|---|
url (required) | string | - | Local directory path (e.g., /app/data/inputs/orders). |
sftp
An example for provider sftp:
Code
Connection
Use settings.connection_name for a saved connection, or configure it inline:
| Field | Type | Default | Notes |
|---|---|---|---|
url (required) | string | - | Remote directory path on the SFTP server (e.g., sftp://home/user/data or /home/user/data). |
host (required) | string | - | SFTP server hostname or IP address. |
port | integer | 22 | SFTP port (default: 22). Range: 1 to 65535. |
auth (required) | object | - | - |
auth.user (required) | string | - | SSH/SFTP username. |
auth.password (required) | string | - | SSH/SFTP password. |
onedrive
An example for provider onedrive:
Code
Connection
Use settings.connection_name for a saved connection, or configure it inline:
| Field | Type | Default | Notes |
|---|---|---|---|
url (required) | string | - | Microsoft Graph API URL to list folder children (e.g., https://graph.microsoft.com/v1.0/users/{user}/drive/root:/{path}:/children). |
email (required) | string | - | Email address of the OneDrive user (e.g., user@example.com). |
auth (required) | object | - | - |
auth.tenant_id (required) | string | - | Tenant ID for Azure authentication. |
auth.client_id (required) | string | - | Client ID for Azure authentication. |
auth.client_secret (required) | string | - | Client secret for Azure authentication. |
sharepoint
An example for provider sharepoint:
Code
Connection
Use settings.connection_name for a saved connection, or configure it inline:
| Field | Type | Default | Notes |
|---|---|---|---|
url (required) | string | - | Microsoft Graph API URL to list folder children (e.g., https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/root:/{path}:/children). |
site_id (required) | string | - | Site ID of the SharePoint site (e.g., site-id). |
drive_id (required) | string | - | Drive ID of the SharePoint document library (e.g., b!abc123def456ghi789jkl012mno345). |
auth (required) | object | - | - |
auth.tenant_id (required) | string | - | Tenant ID for Azure authentication. |
auth.client_id (required) | string | - | Client ID for Azure authentication. |
auth.client_secret (required) | string | - | Client secret for Azure authentication. |
Streaming query options
These apply to every output in a streaming pipeline:
| Field | Type | Default | Notes |
|---|---|---|---|
output_mode | append or complete or update | append | Output mode of the streaming query. append: only new rows; complete: full result table; update: only updated rows (since 2.0). Maps to outputMode. |
trigger_interval | string | - | Trigger interval for processing (e.g. '10 seconds', '1 minute'). When set, uses Trigger.ProcessingTime(interval). Maps to triggerInterval. |
checkpoint_location | string | - | Optional custom checkpoint directory. When not set, a default under /app/data/spark-checkpoints/ is used. Maps to checkpointLocation. |
query_name | string | - | Name for the streaming query (for monitoring and debugging). Maps to queryName. |
File format options
An output's options depend on its format:
Partitioning (layout)
Defines the partitioning strategy for file system destinations.
Default
Let Spark decide the number of output files based on natural partitioning.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | default | - | - |
Single File
Coalesce all data into a single output file.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | single_file | - | - |
Fixed Files Count
Repartition data into exactly N files of roughly equal size.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | fixed_files_count | - | - |
configs (required) | object | - | - |
configs.files_count (required) | integer | - | Exact number of output files to produce. Minimum: 1. |
Partition By
Split output into a folder hierarchy based on column values (e.g. year/month/day).
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | partition_by | - | - |
configs (required) | object | - | - |
configs.columns (required) | array of object | - | Ordered list of columns to partition by. |
configs.columns[].name (required) | string | - | - |
Rows Per File
Split output so that each file contains approximately N rows.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | rows_per_file | - | - |
configs (required) | object | - | - |
configs.rows_per_file (required) | integer | - | Target number of rows per output file. Minimum: 1. |
Time Bucket
Partition output by a truncated time interval (e.g. hour, day, month). Creates a folder hierarchy based on the bucket value.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | time_bucket | - | - |
configs (required) | object | - | - |
configs.interval (required) | string | - | Truncation interval for the time bucket (e.g. 'year', 'month', 'day', 'hour', 'minute'). |
configs.column | string | - | Timestamp column to bucket by. Defaults to current_timestamp() if omitted. |
Block Size
Repartition output so each file is approximately the given size in kilobytes.
| Field | Type | Default | Notes |
|---|---|---|---|
strategy (required) | block_size | - | - |
configs (required) | object | - | - |
configs.size_kb (required) | integer | - | Target size of each output file in kilobytes. Minimum: 1. |
csv
Valid options for CSV output operations based on Spark CSV data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
delimiter | string | - | Sets the single character used for separating fields. |
encoding | string | - | For reading, decodes the CSV files by the given encoding type. For writing, specifies encoding (charset) of saved CSV files. |
quote | string | - | Sets the single character used for escaping quoted values. |
quote_all | boolean | - | Indicates whether all values should always be enclosed in quotes. Maps to quoteAll. |
escape | string | - | Sets the single character used for escaping quotes inside an already quoted value. |
escape_quotes | boolean | - | Indicates whether values containing quotes should always be enclosed in quotes. Maps to escapeQuotes. |
header | boolean | true | Uses the first line as names of columns. Default: false. |
ignore_leading_white_space | boolean | - | Indicates whether leading whitespaces should be ignored. Maps to ignoreLeadingWhiteSpace. |
ignore_trailing_white_space | boolean | - | Indicates whether trailing whitespaces should be ignored. Maps to ignoreTrailingWhiteSpace. |
null_value | string | - | Sets the string representation of a null value. Maps to nullValue. |
date_format | string | - | Sets the string that indicates a date format. Maps to dateFormat. |
timestamp_format | string | - | Sets the string that indicates a timestamp format. Maps to timestampFormat. |
timestamp_without_timezone_format | string | - | Sets the string that indicates a timestamp without time zone format. Maps to timestampNTZFormat. |
char_to_escape_quote_escaping | string | - | Sets the character to escape quote escaping. Maps to charToEscapeQuoteEscaping. |
empty_value | string | - | Sets the string representation of an empty value. Maps to emptyValue. |
line_separator | string | - | Defines the line separator that should be used for writing. Maps to lineSep. |
compression | none or bzip2 or deflate or gzip or lz4 or snappy or zstd | - | Compression codec to use when saving to file. Default: none. |
excel
Valid options for writing Excel files via crealytics spark-excel
| Field | Type | Default | Notes |
|---|---|---|---|
header | boolean | true | Write the first row as column names. |
data_address | string | - | Cell address or range where to write (e.g. "'My Sheet'!A1"). Used with append mode for multiple sheets. Maps to dataAddress. |
treat_empty_values_as_nulls | boolean | - | When true, empty values are treated as null. Maps to treatEmptyValuesAsNulls. |
date_format | string | - | Format string for date columns. Maps to dateFormat. |
timestamp_format | string | - | Format string for timestamp columns. Maps to timestampFormat. |
use_plain_number_format | boolean | false | When true, write numbers without rounding or scientific notation. Maps to usePlainNumberFormat. |
max_rows_in_memory | integer | - | Maximum number of rows to write in memory. When set, it uses a streaming writer which can help with big files. Maps to maxRowsInMemory. |
json
Valid options for JSON output operations based on Spark JSON data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
compression | none or bzip2 or deflate or gzip or lz4 or snappy or zstd | - | Compression codec to use when saving to file. Default: none. |
date_format | string | - | Sets the string that indicates a date format. Default is "yyyy-MM-dd". Maps to dateFormat. |
encoding | string | - | Specifies encoding (charset) of saved JSON files. |
ignore_null_fields | boolean | - | Whether to ignore null fields when generating JSON objects. Default: false. Maps to ignoreNullFields. |
line_separator | string | - | Defines the line separator that should be used for writing. Maps to lineSep. |
timestamp_format | string | - | Sets the string that indicates a timestamp format. Default is "yyyy-MM-dd'T'HH:mmtimestampFormat. |
timestamp_without_timezone_format | string | - | Sets the string that indicates a timestamp without time zone format. Default is "yyyy-MM-dd'T'HH:mmtimestampNTZFormat. |
time_zone | string | - | Sets the string that indicates a time zone ID to be used to format timestamps. Maps to timeZone. |
orc
Valid options for ORC output operations based on Spark ORC data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
compression | none or snappy or zlib or lzo or zstd or lz4 | - | Compression codec to use when saving to file. This will override orc.compress and spark.sql.orc.compression.codec. Default: snappy. |
parquet
Valid options for Parquet output operations based on Spark Parquet data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
compression | none or uncompressed or snappy or gzip or lzo or brotli or lz4 or zstd | - | Compression codec to use when saving to file. Default: snappy. |
block_size | integer | - | The size of the block to write to the file (bytes). Default: 134217728 (128 MB). Maps to parquet.block.size. |
text
Valid options for Text output operations based on Spark Text data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
compression | none or bzip2 or deflate or gzip or lz4 or snappy or zstd | - | Compression codec to use when saving to file. Default: none. |
line_separator | string | - | Defines the line separator that should be used for writing. Default is \n. Maps to lineSep. |
avro
Valid options for Avro output operations based on Spark Avro data source version 3.5.1
| Field | Type | Default | Notes |
|---|---|---|---|
compression | uncompressed or snappy or deflate or bzip2 or xz or zstandard | - | Compression codec to use when saving to Avro file. Default: snappy. |
record_name | string | - | Top level record name in write result. Default: topLevelRecord. Maps to recordName. |
record_namespace | string | - | Record namespace in write result. Default: empty string. Maps to recordNamespace. |