CQL (Aster TSDB)
Time series data, such as tag values and events, is stored here. What this storage engine excels at is reading a single tag's data over a specific time range in milliseconds.
| Item | Value |
|---|---|
| Port | 9042 |
| Keyspace | pp |
| Representative Tables | pp.tm_tag_point · tm_tag_point_archive · tm_tag_point_snapshot · pp.ts_data_points · pp.tm_asset_data |
| Engine | Aster TSDB fork for industrial time series → Time Series Database |
Connecting
docker exec -it plantpulse-datalake pd node cql
🔴 CQL is not SQL
Aster TSDB is a storage engine that finds data by partition key and scans in clustering order. Follow just this one rule — provide the partition key and time range in WHERE.
-- ✅ 이렇게
SELECT * FROM pp.tm_tag_point
WHERE tag_id = 'TAG-001'
AND timestamp >= '2026-07-01' AND timestamp < '2026-07-02';
-- ❌ 이렇게 하지 마십시오
SELECT * FROM pp.tm_tag_point WHERE value > 100 ALLOW FILTERING;
The
ALLOW FILTERING is a warning, not a permissionThe fact that Aster TSDB requires this means it must scan all nodes. Running this on a production cluster will slow down all other queries at that moment. Send such queries to Spark SQL.
Examples
Recent values
SELECT timestamp, value FROM pp.tm_tag_point
WHERE tag_id = 'TAG-001'
ORDER BY timestamp DESC
LIMIT 20;
Time range slicing
SELECT timestamp, value, quality FROM pp.tm_tag_point
WHERE tag_id = 'TAG-001'
AND timestamp >= '2026-07-01 08:00' AND timestamp < '2026-07-01 09:00';
Hourly average — computed on the server
SELECT time_bucket(1h, timestamp) AS bucket, avg(value)
FROM pp.tm_tag_point
WHERE tag_id = 'TAG-001'
AND timestamp >= '2026-07-01' AND timestamp < '2026-07-02'
GROUP BY tag_id, time_bucket(1h, timestamp);
21 time series functions, including time_bucket, are built in → Time Series Functions.
Log body search
SELECT ts, msg FROM logs
WHERE device = 'pump-01'
AND ts >= '2026-07-31' AND ts < '2026-08-01'
AND msg LIKE '%타임아웃%';
This works without ALLOW FILTERING → Full-Text Search.
Viewing the schema
DESCRIBE KEYSPACES;
DESCRIBE TABLE pp.tm_tag_point;
-- 이 테이블에 걸린 컴팩션·계층화 설정
SELECT compaction, extensions FROM system_schema.tables
WHERE keyspace_name = 'pp' AND table_name = 'tm_tag_point';
Things to know
- Sorting is only possible in the clustering key direction. You cannot sort by any arbitrary column using
ORDER BY. - No joins. If you need to combine multiple tables, that's what Spark SQL is for.
- Per-table TTL, compression strategy, and size are shown in
pd retention. - Even if old data is compressed, queries are identical —
SELECThandles the merging automatically → Tiered Storage.
See also
- Time Series Database — functions · compression · full-text search
- Client Libraries — how to connect from a program