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. Write Strategies

On this page

  1. External Storage
  2. INSERT INTO
  3. Trino, today the only write-capable adapter
  4. Write Capability by Adapter
  5. Responsibility Boundaries

Write Strategies

How a write strategy runs, for both storage and INSERT paths, across adapters.

A write runs through the strategy configured for the data source. Each strategy takes the records to write plus a load strategy. The write() call resolves with no value. It either completes or throws.

External Storage #

1
2
3
4
5
6
records
  → serializer        (records → a file format)
  → storage upload    (write the file to object storage)
  → table manager     (register/update the table via DDL)
  → cleanup           (according to the load strategy)

This path needs a serializer, storage operations, and a table manager. It suits engines backed by object storage with an external table catalog. A write call without a resolvable basePath throws.

INSERT INTO #

1
2
3
4
5
6
records
  → schema mapper
  → batched statements
  → data source query (INSERT INTO)
  → optional staging + swap

This path runs entirely through SQL and does not depend on object storage.

Trino, today the only write-capable adapter #

Trino implements both preceding paths, selected by its writeConfig. This page covers the mechanics every write-capable adapter shares, not any one adapter's config format. See Trino write config for the two concrete shapes side by side.

Write Capability by Adapter #

AdapterExternal storageINSERT INTO
TrinoYesYes
FabricNo — read-only adapterNo — read-only adapter

A future write-capable adapter adds a row here, plus its own <adapter>/write-config.mdx page for the concrete shape. It does not need a new section.

Responsibility Boundaries #

Each part has a narrow job. The data source executes SQL and exposes DDL. The write strategy owns load-strategy semantics, batching, staging, and rollback. The serializer converts records to a format. Storage operations handle upload, list, and delete without knowing load strategies. The table manager handles external-table DDL only for strategies that need it.

Previous page

Writing

Next page

Load Strategies