Package-level declarations

Types

Link copied to clipboard
data class ClickHouseColumn(val name: String, val type: String)

One column as system.columns reports it.

Link copied to clipboard
data class ClickHouseDatasetDraft(val document: ObjectNode, val skipped: List<ClickHouseColumn>)

A dataset declaration drafted from a table: its document, in the format of a dataset file, and the columns it leaves out because a dataset cannot declare their type.

Link copied to clipboard

Drafts a dataset declaration from what system.columns proves about a table, with the rules ClickHouseQuerySchemaAdapter checks a declaration by, so a draft always passes that check (dataset platform design §4.1). What only a person can decide is left for them:

Link copied to clipboard
data class ClickHouseDatasetOptions(val defaultDatabase: String = "default", val limits: Map<QueryEntry, ClickHouseQueryLimits> = ClickHouseQueryLimits.DEFAULTS, val metadataTtl: Duration = Duration.ofMinutes(1))

How a ClickHouseDatasetQueryBackendFactory reaches its datasets.

Link copied to clipboard

The four query primitives over one dataset's table. Every statement runs under the limits of the query's entry (ClickHouseDatasetOptions.limits) and reads FINAL when the dataset deduplicates.

Link copied to clipboard
class ClickHouseDatasetQueryBackendFactory @JvmOverloads constructor(executor: ClickHouseExecutor, options: ClickHouseDatasetOptions = ClickHouseDatasetOptions(), sources: Map<String, ClickHouseSource> = emptyMap()) : AbstractDatasetQueryBackendFactory

Creates each dataset's ClickHouse backend and storage adapter: over the default source's executor, or over the named source among sources that its storage binding names.

Link copied to clipboard
data class ClickHouseDatasetStorage(val database: String, val table: String, val deduplicate: ClickHouseDatasetStorage.Deduplicate = Deduplicate.NONE, val source: String? = null)

Where a dataset's records live, read from its storage binding:

Link copied to clipboard
class ClickHouseExecutor(client: Client, scheduler: Scheduler = DEFAULT_SCHEDULER)

Runs statements over the HTTP client and decodes JSONEachRow, one record per line.

Link copied to clipboard
data class ClickHouseQueryLimits(val maxExecutionTime: Duration? = null, val maxRowsToRead: Long? = null, val maxResultRows: Long? = null, val maxMemoryUsage: Long? = null)

What one query may cost ClickHouse, sent as server settings so ClickHouse enforces it: a query over a limit fails rather than returning a truncated result. null leaves the server's own setting.

Link copied to clipboard

What a dataset's table proves about its declaration (design §4.2, §5.2). The declaration is the contract and the table only confirms it: every declared field must be a root column of a supported type whose family matches the declared types, a non-null declaration needs a non-Nullable column, and the scope and identity columns must not be Nullable. FINAL needs an engine that merges rows. Any mismatch fails the compile, so the Catalog keeps the previous schema and reports it; a column the declaration does not name is never exposed.

Link copied to clipboard
data class ClickHouseSource(val executor: ClickHouseExecutor, val database: String)

A named ClickHouse server a dataset can be read from: its executor and the database of a bare table name.

Link copied to clipboard
class ClickHouseStatement(val sql: String, val parameters: Map<String, Any>)

One statement and its server-side parameters. Every caller value is bound as a typed parameter ({p0:String}); the SQL text holds only identifiers from the compiled schema, function names and finite numeric constants.

Link copied to clipboard
data class ClickHouseTable(val database: String, val name: String, val engine: String, val columns: Map<String, ClickHouseColumn>)

A table or view, its engine and its columns by name.

Link copied to clipboard

The family of a column's base type: what decides its capabilities and how operands are bound.

Functions

Link copied to clipboard
fun quoteIdentifier(identifier: String): String

Quotes an identifier that comes from the compiled schema, never from a caller.