From 9960cb4eb4f068d1b9e860fab6c2e96758693a49 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Sat, 5 Aug 2023 17:14:17 +0100 Subject: [PATCH] Fix ordering --- sql/combine.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/combine.sql b/sql/combine.sql index 486c7efa..f9d48574 100644 --- a/sql/combine.sql +++ b/sql/combine.sql @@ -3,5 +3,6 @@ PRAGMA threads=4; SET enable_progress_bar=true; CREATE TABLE temp_table AS select regexp_extract(filename, '(\d+)\.parquet', 1)::USMALLINT as repository, * exclude (filename) -FROM read_parquet('input/*.parquet', union_by_name = True, filename = true); +FROM read_parquet('input/*.parquet', union_by_name = True, filename = true) +order by (uploaded_on, path); COPY temp_table TO 'output.parquet' (FORMAT PARQUET, COMPRESSION zstd);