From 944bd03f2ba7f7726619c19ccbd25336afa280f6 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Wed, 2 Aug 2023 15:19:52 +0100 Subject: [PATCH] Maybe try this? --- sql/unique_python_files.prql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/unique_python_files.prql b/sql/unique_python_files.prql index 65205b5a..f6a62d75 100644 --- a/sql/unique_python_files.prql +++ b/sql/unique_python_files.prql @@ -3,5 +3,9 @@ prql target:sql.duckdb from (read_parquet $1) filter s"suffix({path}, '.py')" filter skip_reason == "" -select {s"distinct on({hash}) {hash}", path, repository, uploaded_on} -sort {uploaded_on} \ No newline at end of file +group {hash} ( + sort {uploaded_on} + take 1 + select {hash, path, repository, uploaded_on} +) +select {hash, path, uploaded_on} | sort {path}