LakeQL
Overview
  • Introduction
  • Datasource Contract
  • API Reference
Writing
  • Write Strategies
  • Load Strategies
  • Partitioning
Storage
  • Storage Operations
Trino
  • Connection
  • Write Config
  • Metadata
  • API Reference
Fabric
  • Connection
  • Metadata
  • API Reference
GitHub
LakeQL
  1. Data Sources
  2. Writing
  3. Partitioning

On this page

  1. Partitioning Modes
  2. Format Granularity
  3. Field and Custom Partitioning

Partitioning

Control how written files are partitioned in object storage.

The external-storage write strategy can partition the files it writes, producing Hive-style partition paths. Two fields on the write config control it: partitioning and partitioningFormat.

Partitioning Modes #

partitioning accepts a boolean or a string, resolving to one of four modes:

ValueModeBehavior
true (default)timestampPartition by the write timestamp.
falsedisabledWrite a flat path, no partitioning.
"fieldName"fieldPartition by a record field's date value.
"a:year/b"customPartition by a custom format string (contains / or :).

Format Granularity #

partitioningFormat sets the granularity for timestamp and field modes. It defaults to "year/month/day", producing paths like year=2026/month=08/day=29/<uuid>.parquet.

Field and Custom Partitioning #

In field mode, each record is grouped by the date value of the named field. In custom mode, a format string composes the path from one or more fields, optionally extracting a date component per segment (for example, event_date:year extracts the year from an ISO date). Records that share a partition key land in the same file.

A record whose partition field is missing, null, or an unparseable date raises a PartitionFieldError that names the field and the offending record index.

Partitioning applies only to the external-storage strategy. The INSERT strategy writes rows through SQL and does not partition files.

Previous page

Load Strategies

Next page

Storage