Created
March 15, 2019 14:06
-
-
Save mreid-moz/17c9c57edfe91cdea498702be0513e78 to your computer and use it in GitHub Desktop.
Using a BigQuery udf from the bq cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat udf.sql | |
CREATE TEMP FUNCTION foo(v STRING) AS ( | |
(SELECT concat(v, 'foo')) | |
); | |
$ cat bq_test.sql | |
SELECT os, foo(os) FROM telemetry.clients_daily_v6 WHERE submission_date_s3 = '2019-02-10' LIMIT 3 | |
$ cat udf.sql bq_test.sql | bq query | |
Waiting on bqjob_r167fb1853f68d6fd_000001694a7a7543_1 ... (0s) Current status: DONE | |
+------------+---------------+ | |
| os | f0_ | | |
+------------+---------------+ | |
| Darwin | Darwinfoo | | |
| Windows_95 | Windows_95foo | | |
| Windows_NT | Windows_NTfoo | | |
+------------+---------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment