From 5a00317dcca6a223db93c058aee01c1f88a36afb Mon Sep 17 00:00:00 2001 From: nickfelt Date: Mon, 27 Feb 2017 12:53:51 -0800 Subject: [PATCH] Exclude SYNTHETIC flag from BillingData BigQuery view The BillingData view is intended to be the stable, clean source of data for the invoicing pipeline and detail report output. As such, cutting over to the synthetically created OneTimes is an implementation detail and shouldn't be visible in the output (esp. since that goes straight to the detail reports that registrars receive, and it'd probably just be confusing for them). I think it's fair to generically exclude the SYNTHETIC flag from showing up here - it will still be in BigQuery on the individual OneTimes if we want to look for it. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148682719 --- java/google/registry/tools/sql/billing_data_view.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/google/registry/tools/sql/billing_data_view.sql b/java/google/registry/tools/sql/billing_data_view.sql index 5a8a7f14d..0a859b4d3 100644 --- a/java/google/registry/tools/sql/billing_data_view.sql +++ b/java/google/registry/tools/sql/billing_data_view.sql @@ -56,8 +56,9 @@ FROM ( -- Parse out the amount of minor units by stripping out non-digit chars -- (i.e. currency, space, and period) and then converting to integer. INTEGER(REGEXP_REPLACE(cost, r'\D+', '')) AS amountMinor, - -- Convert repeated flags field into flat comma-delimited string field. - GROUP_CONCAT(flags) WITHIN RECORD AS flags, + -- Convert repeated flags field into flat comma-delimited string field, + -- excluding the internal-only flag 'SYNTHETIC'. + GROUP_CONCAT(IF(flags != 'SYNTHETIC', flags, NULL)) WITHIN RECORD AS flags, -- Cancellations for recurring events will point to the recurring event's -- key, which is stored in cancellationMatchingBillingEvent. The path -- contains kind, id, and domainRepoId, all of which must match, so just