Fading Coder

One Final Commit for the Last Sprint

Rounding Timestamps to Interval Boundaries in Python and SQL

Problem Statement When performing time-based data analysis, there's often a need to align timestamps to predefineed interval boundaries. For instance, given a timestamp like 2024-03-26 14:25:59, you might want to group it into 30-minute buckets, resulting in 2024-03-26 14:00:00. This operation is co...

Choosing a ClickHouse Table Engine with Practical Patterns and Examples

Selecting a ClickHouse table engine shapes how data is laid out on disk, how it’s indexed and merged, what kinds of queries are efficient, and how ingestion behaves under concurrency. Engines fall into several families with orthogonal add‑ons for replication and sharding. Engine families at a glance...

Using Array Functions for Rank Operations in ClickHouse

Implementing Rank Functions in ClickHouse with Array Functions ClickHouse enables implementing rank functions commonly found in SQL databases using specialized array functions. The main functions discussed are: arrayEnumerate arrayEnumerateDense arrayEnumerateUniq These funcitons return indices corr...

Clickhouse Shards and Replication Setup

A replica in Clickhouse is essentially two or more tables or table segments containing identical data, typically intended for redundancy and data integrity. Sharding, on the other hand, divides table data horizontally across different servers, alleviating the workload on individual nodes. Clickhouse...

Data Types in ClickHouse

ClickHouse offers a diverse set of data types categorized into basic, composite, and specialized types. Data types supported by ClickHouse along with their metadata can be explored using the system table data_type_families. Below is an SQL query to retrieve these details: SELECT * FROM system.data_t...