Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create pudl.duckdb from parquet files #3741

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docker/gcp_pudl_etl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ function distribute_parquet() {
fi
}

function create_and_distribute_duckdb() {
echo "Creating DuckDB file from parquet files and copying it to GCS"
GCS_PATH="gs://superset.catalyst.coop"
parquet_to_duckdb "$PUDL_OUTPUT/parquet" "$PUDL_OUTPUT/pudl.duckdb" && \
gsutil -q -m -u "$GCP_BILLING_PROJECT" cp "$PUDL_OUTPUT/pudl.duckdb" "$GCS_PATH"
}

function copy_outputs_to_distribution_bucket() {
# Only attempt to update outputs if we have a real value of BUILD_REF
# This avoids accidentally blowing away the whole bucket if it's not set.
Expand Down Expand Up @@ -282,6 +289,9 @@ if [[ $ETL_SUCCESS == 0 ]]; then
# Distribute Parquet outputs to a private bucket
distribute_parquet 2>&1 | tee -a "$LOGFILE"
DISTRIBUTE_PARQUET_SUCCESS=${PIPESTATUS[0]}
# Create duckdb file from parquet files
create_duckdb 2>&1 | tee -a "$LOGFILE"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create_duckdb() or create_and_distribute_duckdb()?

(I have been loving the ShellCheck linter for VSCode)

CREATE_DUCKDB_SUCCESS=${PIPESTATUS[0]}
# Remove some cruft from the builds that we don't want to distribute
clean_up_outputs_for_distribution 2>&1 | tee -a "$LOGFILE"
CLEAN_UP_OUTPUTS_SUCCESS=${PIPESTATUS[0]}
Expand Down Expand Up @@ -313,6 +323,7 @@ if [[ $ETL_SUCCESS == 0 && \
$UPDATE_STABLE_SUCCESS == 0 && \
$DATASETTE_SUCCESS == 0 && \
$DISTRIBUTE_PARQUET_SUCCESS == 0 && \
$CREATE_DUCKDB_SUCCESS == 0 && \
$CLEAN_UP_OUTPUTS_SUCCESS == 0 && \
$DISTRIBUTION_BUCKET_SUCCESS == 0 && \
$GCS_TEMPORARY_HOLD_SUCCESS == 0 && \
Expand Down
13 changes: 7 additions & 6 deletions environments/conda-linux-64.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading