adobe / helix-run-query

service that executes queries on BigQuery datasets generated by Helix-Logging
Apache License 2.0
6 stars 11 forks source link

feat: backend to add key to multiple domains in one call #1066

Closed langswei closed 9 months ago

langswei commented 9 months ago

As part of the RUM for AEM CS initiative, we are getting requests for 100s of domains to share a single domain key. It would be a nice convenience to create the domain key for all domains in one request.

This PR is to document and discuss a change to the table function helix_reporting.ROTATE_DOMAIN_KEYS which is a pre-requisite to a run-query change. Upon approval, I will make the table function change in BigQuery and move on to the run-query changes.

This change is backward compatible -- a single domain may still be passed in. A test implementation exists at helix_reporting.ROTATE_DOMAIN_KEYS_MULTIPLE for now.

CALL helix_reporting.ROTATE_DOMAIN_KEYS_MULTIPLE(
    '<uber_domain_key>',
    '<domain or comma-separated domain list>',
    'UTC',
    -1,
    '-',
    '<desired domain key>',
    true,
    'multiple_test'
);

select * from helix_reporting.domain_keys where note = 'multiple_test';
github-actions[bot] commented 9 months ago

This PR will trigger a minor release when merged.

langswei commented 9 months ago

I think it is weird to do this in a for loop when both UPDATE and INSERT INTO are perfectly fine in accepting a series of rows.

@trieloff Good call, check now.

langswei commented 9 months ago

Updated table function in BQ and no further run-query changes required. Tested and works.

trieloff commented 9 months ago

:tada: This PR is included in version 3.16.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: