Skip to content

Commit 8e643d6

Browse files
committed
ENH: include aws_bucket as a separate column
The idea is to phase out aws_series_url over time. Adding this as an extra column will make transition and debugging easier.
1 parent b0211e8 commit 8e643d6

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

scripts/sql/idc_index.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ SELECT
2323
COUNT(dicom_all.SOPInstanceUID) AS instanceCount,
2424
ANY_VALUE(license_short_name) as license_short_name,
2525
# download related attributes
26+
ANY_VALUE(aws_bucket) AS aws_bucket,
27+
ANY_VALUE(crdc_series_uuid) AS crdc_series_uuid,
28+
# series_aws_url will be phased out in favor of constructing URL from bucket+UUID
2629
ANY_VALUE(CONCAT(series_aws_url,"*")) AS series_aws_url,
2730
ROUND(SUM(SAFE_CAST(instance_size AS float64))/1000000, 2) AS series_size_MB,
2831
FROM

scripts/sql/prior_versions_index.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ SELECT
7272
WHEN gcs_bucket='idc-open-idc1' THEN CONCAT('s3://','idc-open-data-two/',crdc_series_uuid, '/*')
7373
WHEN gcs_bucket='idc-open-cr' THEN CONCAT('s3://','idc-open-data-cr/',crdc_series_uuid, '/*')
7474
END AS series_aws_url,
75+
76+
gcs_bucket,
77+
CASE
78+
79+
# map GCS bucket to AWS bucket, since for idc-index we prefer AWS
80+
# if new buckets are included in IDC, this will need to be updated!
81+
82+
WHEN gcs_bucket='public-datasets-idc' THEN 'idc-open-data'
83+
WHEN gcs_bucket='idc-open-idc1' THEN 'idc-open-data-two'
84+
WHEN gcs_bucket='idc-open-cr' THEN 'idc-open-data-cr'
85+
END AS aws_bucket,
7586
MIN(idc_version) AS min_idc_version,
7687
MAX(idc_version) AS max_idc_version
7788
FROM all_versions

0 commit comments

Comments
 (0)