Reference

ClickHouse compatibility

Separate RawTree database behavior from Query API statement restrictions.

ClickHouse compatibility

RawTree is a database forked from ClickHouse. It shares SQL execution and constructs such as users, roles, grants, row policies, settings profiles, workloads, and resources. Its raw tables and adaptive behavior add or change parts of that model. A fork does not imply complete compatibility with every upstream version, engine, setting, or deployment.

Database capabilities and differences

AreaRawTree behavior
SQL and database objectsSQL defines reads, writes, access controls, and workload scheduling.
Raw tablesUndeclared JSON fields live in __raw_data and appear as logical columns.
Dynamic fieldsStored types can vary by row. Conversions and exact type extraction have different semantics.
Physical optimizationRaw tables can use automatic sorting keys and optional automatic projections.
InspectionSystem tables, statistics, and EXPLAIN expose database behavior. Query hints report runtime type-compatibility warnings.

See Raw tables, Dynamic fields, and Adaptive optimization for these differences. Generated reference pages describe the engine binary used for this build. Configuration and the table engine still determine which features apply.

Service interfaces

RawTree Cloud and RawTree BYOC expose the database through service APIs. The Query API validates supported statement forms before sending SQL to RawTree. Its restrictions are not a complete description of database capabilities.

For example, RawTree supports SQL users. The service creates a database user for a database-role API key, but the public Query API rejects CREATE USER. API key lifecycle belongs to the service, while the database enforces grants.

Query API statement support

The following table applies to POST /v1/query in this service version. Not exposed means that this API rejects the statement. It does not mean that RawTree lacks the corresponding database capability. Supported entries still have syntax and permission limits in the statement reference.

Statement or featureQuery API status
SELECT, WITH, EXPLAIN, DESCRIBESupported
CREATE ROLE, DROP ROLE, selected GRANT formsSupported
CREATE ROW POLICY, DROP ROW POLICYSupported
CREATE SETTINGS PROFILE, DROP SETTINGS PROFILESupported
CREATE WORKLOAD, DROP WORKLOAD, CREATE RESOURCE, DROP RESOURCESupported
CREATE NAMED COLLECTIONSupported
CREATE USERNot exposed
CREATE TABLE with ReplicatedRawMergeTreeSupported
INSERT INTO ... SELECTSupported
ALTER TABLE ... MODIFY ORDER BYSupported
ALTER TABLE ... MODIFY SETTING and RESET SETTINGSupported
Projection ADD, MATERIALIZE, CLEAR, and DROPSupported
Index ADD, MATERIALIZE, CLEAR, and DROPSupported
ALTER and DROP NAMED COLLECTIONNot exposed
KILL MUTATIONSupported
CREATE MATERIALIZED VIEWNot exposed
CREATE VIEWNot exposed
CREATE DICTIONARYNot exposed
Table TTLNot exposed
ALTER ROW POLICYNot exposed
ALTER ROLENot exposed
REVOKENot exposed
SET ROLENot exposed
Lightweight DELETENot exposed
ALTER TABLE ... DELETE/UPDATE mutationsNot exposed
UPDATENot exposed
OPTIMIZENot exposed
TRUNCATENot exposed
RENAMENot exposed
ALTER SETTINGS PROFILENot exposed
INSERT ... VALUESNot exposed
INSERT ... FORMATNot exposed
INSERT INTO FUNCTIONNot exposed
URL table functions in INSERT ... SELECTNot exposed

Verified Query API rejections

These examples test the service interface. They do not test direct database execution and must not be used as an engine compatibility test.

Create a materialized view.

CREATE MATERIALIZED VIEW daily_view ENGINE = ReplicatedRawMergeTree AS SELECT 1

Create a view.

CREATE VIEW daily_view AS SELECT 1

Create a dictionary.

CREATE DICTIONARY daily_dictionary (id UInt64) PRIMARY KEY id SOURCE(CLICKHOUSE(TABLE 'events')) LAYOUT(FLAT()) LIFETIME(0)

Create a table with a TTL clause.

CREATE TABLE ttl_events ENGINE = ReplicatedRawMergeTree ORDER BY event_time TTL event_time + INTERVAL 1 DAY

Alter a row policy.

ALTER ROW POLICY acme_statement_only ON events USING 1

Alter a role.

ALTER ROLE events_statement_reader

Revoke a grant.

REVOKE SELECT ON analytics.events FROM events_statement_reader

Set the active role.

SET ROLE events_statement_reader

Use lightweight delete syntax.

DELETE FROM events WHERE event_time < 1

Use an ALTER TABLE delete mutation.

ALTER TABLE events DELETE WHERE event_time < 1

Update a table row.

UPDATE events SET event_time = 1 WHERE tenant = 'north'

Optimize a table.

OPTIMIZE TABLE events

Truncate a table.

TRUNCATE TABLE events

Rename a table.

RENAME TABLE events TO archived_events

Alter a settings profile.

ALTER SETTINGS PROFILE profile_statement_profile SETTINGS workload = 'default'

Insert literal values.

INSERT INTO events VALUES (1)

Insert rows in a format.

INSERT INTO events FORMAT JSONEachRow

Insert into a table function.

INSERT INTO FUNCTION file('events.csv') SELECT 1

Read an external table function during an insert.

INSERT INTO events SELECT * FROM url('https://example.com/events.csv', 'CSV')