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
| Area | RawTree behavior |
|---|---|
| SQL and database objects | SQL defines reads, writes, access controls, and workload scheduling. |
| Raw tables | Undeclared JSON fields live in __raw_data and appear as logical columns. |
| Dynamic fields | Stored types can vary by row. Conversions and exact type extraction have different semantics. |
| Physical optimization | Raw tables can use automatic sorting keys and optional automatic projections. |
| Inspection | System 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 feature | Query API status |
|---|---|
SELECT, WITH, EXPLAIN, DESCRIBE | Supported |
CREATE ROLE, DROP ROLE, selected GRANT forms | Supported |
CREATE ROW POLICY, DROP ROW POLICY | Supported |
CREATE SETTINGS PROFILE, DROP SETTINGS PROFILE | Supported |
CREATE WORKLOAD, DROP WORKLOAD, CREATE RESOURCE, DROP RESOURCE | Supported |
CREATE NAMED COLLECTION | Supported |
CREATE USER | Not exposed |
CREATE TABLE with ReplicatedRawMergeTree | Supported |
INSERT INTO ... SELECT | Supported |
ALTER TABLE ... MODIFY ORDER BY | Supported |
ALTER TABLE ... MODIFY SETTING and RESET SETTING | Supported |
Projection ADD, MATERIALIZE, CLEAR, and DROP | Supported |
Index ADD, MATERIALIZE, CLEAR, and DROP | Supported |
ALTER and DROP NAMED COLLECTION | Not exposed |
KILL MUTATION | Supported |
CREATE MATERIALIZED VIEW | Not exposed |
CREATE VIEW | Not exposed |
CREATE DICTIONARY | Not exposed |
Table TTL | Not exposed |
ALTER ROW POLICY | Not exposed |
ALTER ROLE | Not exposed |
REVOKE | Not exposed |
SET ROLE | Not exposed |
Lightweight DELETE | Not exposed |
ALTER TABLE ... DELETE/UPDATE mutations | Not exposed |
UPDATE | Not exposed |
OPTIMIZE | Not exposed |
TRUNCATE | Not exposed |
RENAME | Not exposed |
ALTER SETTINGS PROFILE | Not exposed |
INSERT ... VALUES | Not exposed |
INSERT ... FORMAT | Not exposed |
INSERT INTO FUNCTION | Not exposed |
URL table functions in INSERT ... SELECT | Not 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 1Create a view.
CREATE VIEW daily_view AS SELECT 1Create 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 DAYAlter a row policy.
ALTER ROW POLICY acme_statement_only ON events USING 1Alter a role.
ALTER ROLE events_statement_readerRevoke a grant.
REVOKE SELECT ON analytics.events FROM events_statement_readerSet the active role.
SET ROLE events_statement_readerUse lightweight delete syntax.
DELETE FROM events WHERE event_time < 1Use an ALTER TABLE delete mutation.
ALTER TABLE events DELETE WHERE event_time < 1Update a table row.
UPDATE events SET event_time = 1 WHERE tenant = 'north'Optimize a table.
OPTIMIZE TABLE eventsTruncate a table.
TRUNCATE TABLE eventsRename a table.
RENAME TABLE events TO archived_eventsAlter 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 JSONEachRowInsert into a table function.
INSERT INTO FUNCTION file('events.csv') SELECT 1Read an external table function during an insert.
INSERT INTO events SELECT * FROM url('https://example.com/events.csv', 'CSV')