Skip to content

Commit

Permalink
Try this
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Aug 1, 2023
1 parent 9af4403 commit b85292b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sql/combine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ FROM read_parquet('input/*.parquet', union_by_name = True, filename = true);
COPY (
select *
from temp_table
order by (path)
order by (project_name)
) TO 'output.parquet' (FORMAT PARQUET, COMPRESSION zstd);
7 changes: 6 additions & 1 deletion sql/unique_python_files.prql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +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}
select {hash, repository, path, uploaded_on}
group {hash} (
sort uploaded_on
take 1
)
sort path
8 changes: 6 additions & 2 deletions sql/unique_python_files_combine.prql
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
prql target:sql.duckdb

from (read_parquet $1)
select {s"distinct on({hash}) {hash}", path}

select {hash, repository, path, uploaded_on}
group {hash} (
sort uploaded_on
take 1
)
sort path

0 comments on commit b85292b

Please sign in to comment.