Skip to main content
Version: Next

DeepLake

Deep Lake sink connector

Support These Engines

Spark
Flink
SeaTunnel Zeta

Key Features

Description

The DeepLake sink appends SeaTunnel rows to a table hosted by the Deep Lake managed service. It uses the Deep Lake REST SQL API and does not require Python or a native Deep Lake client on SeaTunnel workers.

This connector supports managed workspaces reachable through the REST API. Local Deep Lake datasets and Python-only storage paths are not supported.

The sink accepts append-only input. UPDATE_BEFORE, UPDATE_AFTER, and DELETE rows fail instead of being silently appended with incorrect CDC semantics.

Sink Options

NameTypeRequiredDefaultDescription
api_urlstringnohttps://api.deeplake.aiDeep Lake REST API base URL.
api_keystringyes-Deep Lake API key. Keep this value outside source control.
org_idstringyes-Activeloop organization ID sent with each request.
workspacestringyes-Workspace containing the destination table.
tablestringnoupstream table nameDestination table.
batch_sizeintno100Maximum rows sent to the batch query endpoint in one request.
connect_timeout_msintno10000HTTP connection timeout in milliseconds.
socket_timeout_msintno60000HTTP socket timeout in milliseconds.
schema_save_modeenumnoCREATE_SCHEMA_WHEN_NOT_EXISTSchema handling mode. Supported values are CREATE_SCHEMA_WHEN_NOT_EXIST, ERROR_WHEN_SCHEMA_NOT_EXIST, and IGNORE.
multi_table_sink_replicaintno1Parallel replica count for multi-table sink writing.

schema_save_mode

  • CREATE_SCHEMA_WHEN_NOT_EXIST: sends CREATE TABLE IF NOT EXISTS ... USING deeplake before writing.
  • ERROR_WHEN_SCHEMA_NOT_EXIST: validates the table with an empty query and fails when it is unavailable.
  • IGNORE: assumes the table already exists and skips schema validation.

RECREATE_SCHEMA is rejected because dropping a managed dataset is destructive and unsafe when multiple sink writers start concurrently.

Data Type Mapping

SeaTunnel Data TypeDeep Lake SQL Type
BOOLEANBOOLEAN
TINYINTSMALLINT
SMALLINTSMALLINT
INTINTEGER
BIGINTBIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
DECIMALNUMERIC(precision, scale)
STRINGTEXT
BYTESBYTEA
DATEDATE
TIMETIME
TIMESTAMPTIMESTAMP
TIMESTAMP_TZTIMESTAMPTZ
FLOAT_VECTORFLOAT4[]
BINARY_VECTORBYTEA
ARRAYcorresponding supported Deep Lake element type array

FLOAT16_VECTOR, BFLOAT16_VECTOR, SPARSE_FLOAT_VECTOR, MAP, ROW, and arrays containing BYTES or BINARY_VECTOR are not supported in this first version. The connector fails during SQL generation rather than converting these values with a loss of precision or structure.

Delivery Semantics

Rows are buffered in memory and written through Deep Lake's parameterized batch query endpoint. The buffer is cleared only after a successful HTTP response and is flushed when it reaches batch_size, on checkpoint preparation, and when an active writer closes. After a failed write, the writer becomes terminal and closing it does not retry the ambiguous batch.

The connector provides at-least-once delivery. A task failure after Deep Lake accepts a request but before SeaTunnel records the checkpoint can cause the batch to be sent again. A stable primary key can detect duplicates but does not make retries exactly-once. Deduplicate before or after this sink when duplicate rows are not acceptable.

The connector maps each input field to the Deep Lake column with the same name. It does not generate a synthetic record ID. Define a primary key in the upstream schema when the destination needs a stable application-level identifier.

Task Example

env {
parallelism = 1
job.mode = "BATCH"
}

source {
FakeSource {
row.num = 10
schema = {
fields {
document_id = bigint
content = string
score = double
}
}
plugin_output = "documents"
}
}

sink {
DeepLake {
plugin_input = "documents"
api_key = "${DEEPLAKE_API_KEY}"
org_id = "${DEEPLAKE_ORG_ID}"
workspace = "research"
table = "documents"
batch_size = 100
schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
}
}

Changelog

Change Log
ChangeCommitVersion