Skip to content

Commit

Permalink
Combine?
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Jul 29, 2023
1 parent bd8af9b commit 629ca3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unique_python_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
run: |
sudo apt-get install parallel
- name: Combine
- name: Ingest
run: |
mkdir combined/
find dataset/ -name '*.parquet' | parallel -j 1 --xargs -n2 poetry run pypi-data run-sql ${{ github.workspace }}/sql/unique_python_files.prql --output=parquet --threads=2 combined/{#}.parquet {}
- name: Complete
- name: Combine
run: |
poetry run pypi-data run-sql ${{ github.workspace }}/sql/unique_python_files.prql --output=parquet --threads=2 unique-python-files.parquet combined/*.parquet
poetry run pypi-data run-sql ${{ github.workspace }}/sql/unique_python_files_combine.prql --output=parquet --threads=2 unique-python-files.parquet combined/*.parquet
- name: List
run: ls combined/
Expand Down
10 changes: 10 additions & 0 deletions sql/unique_python_files_combine.prql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prql target:sql.duckdb

let any_value = column -> s"any_value({column})"

from (read_parquet $1)
select {hash, path}
group {hash} (
aggregate {
path = any_value(path)
})

0 comments on commit 629ca3e

Please sign in to comment.