실시간 분석데이터 웨어하우징관측성AI/MLOSS
ClickHouse는 SQL 데이터베이스이며, 이미 익숙한 것과 같은 유형의 SELECT 쿼리를 작성해 데이터를 조회합니다. 예시는 다음과 같습니다:
SELECT *
FROM helloworld.my_first_table
ORDER BY timestamp응답이 깔끔한 표 형식으로 반환되는 것을 확인할 수 있습니다:
┌─user_id─┬─message────────────────────────────────────────────┬───────────timestamp─┬──metric─┐
│ 102 │ Insert a lot of rows per batch │ 2022-03-21 00:00:00 │ 1.41421 │
│ 102 │ Sort your data based on your commonly-used queries │ 2022-03-22 00:00:00 │ 2.718 │
│ 101 │ Hello, ClickHouse! │ 2022-03-22 14:04:09 │ -1 │
│ 101 │ Granules are the smallest chunks of data read │ 2022-03-22 14:04:14 │ 3.14159 │
└─────────┴────────────────────────────────────────────────────┴─────────────────────┴─────────┘
4 rows in set. Elapsed: 0.008 sec.FORMAT 절을 추가해 ClickHouse가 지원하는 다양한 출력 형식 중 하나를 지정합니다:
SELECT *
FROM helloworld.my_first_table
ORDER BY timestamp
FORMAT TabSeparated위 쿼리의 출력은 탭으로 구분되어 반환됩니다:
Query id: 3604df1c-acfd-4117-9c56-f86c69721121
102 Insert a lot of rows per batch 2022-03-21 00:00:00 1.41421
102 Sort your data based on your commonly-used queries 2022-03-22 00:00:00 2.718
101 Hello, ClickHouse! 2022-03-22 14:04:09 -1
101 Granules are the smallest chunks of data read 2022-03-22 14:04:14 3.14159
4 rows in set. Elapsed: 0.005 sec.