Skip to content

Accessing tables as files in HTTP interface #46925

@alexey-milovidov

Description

@alexey-milovidov

Allow to add an HTTP handler representing a database or all databases under a specified URL prefix:

prefix/table.tsv
prefix/database/table.json

It contains the database name, the table name, optional data format as a file extension, and optional additional parameters.

The request is processed as SELECT * FROM database.table FORMAT TSV.

The additional parameters are the same as what's available in the HTTP interface, including the settings, like offset, limit, but we should add more parameters for query construction:

columns - provide a subset of columns to return;
where - filter the data by the corresponding expression;
select - write a select query explicitly, omitting the FROM section;

The authentication and access control work as usual.

Additional notes

It composes nicely with #38775.

Content-length, range requests, and ETag are either not implemented or can be implemented by caching the resulting content.

You might want a GraphQL interface, but it's out of scope.

We can also represent it under an S3-compatible interface, although it is much harder to do.

Motivation

Exploration of the possibilities. Proposed by @camuel

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurewarmup taskThe task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions