Skip to content

Commit

Permalink
Normalize disco node name for join (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-soltesz authored Jul 15, 2020
1 parent d47776e commit 580c37e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions config/federation/bigquery/bq_ndt_s2c.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ CREATE TEMPORARY FUNCTION queryDate() AS (
-- Takes ParseInfo.TaskFileName and returns an M-Lab hostname.
CREATE TEMPORARY FUNCTION toNodeName(tfn STRING) AS (
CONCAT(
REGEXP_EXTRACT(tfn, r'(mlab[1-4])-[a-z]{3}[0-9]{2}.*'), ".",
REGEXP_EXTRACT(tfn, r'mlab[1-4]-([a-z]{3}[0-9]{2}).*'),
".measurement-lab.org"
REGEXP_EXTRACT(tfn, r'(mlab[1-4])-[a-z]{3}[0-9]{2}.*'), "-",
REGEXP_EXTRACT(tfn, r'mlab[1-4]-([a-z]{3}[0-9]{2}).*')
)
);

WITH disco_intervals_with_discards AS (
SELECT
hostname AS node,
toNodeName(hostname) AS node,
TIMESTAMP_SUB(sample.timestamp, INTERVAL 10 SECOND) AS tstart,
sample.timestamp AS tend,
sample.value AS discards
Expand Down

0 comments on commit 580c37e

Please sign in to comment.