Skip to content

Instantly share code, notes, and snippets.

View abhinavraj23's full-sized avatar
🎯
Focusing

Abhinav Raj abhinavraj23

🎯
Focusing
View GitHub Profile
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@abhinavraj23
abhinavraj23 / dump.sql
Created May 7, 2021 06:50 — forked from AlexeyKupershtokh/dump.sql
Postgres DDL to Clickhouse converter
select
concat(
'create table ',
table_name,
'(',
string_agg(
concat(
column_name,
' ',
CASE when is_nullable = 'YES' THEN 'Nullable(' END,