Skip to content

Instantly share code, notes, and snippets.

@campoy
Created April 12, 2018 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save campoy/33719f6bec6b506fb3a821096920c076 to your computer and use it in GitHub Desktop.
Save campoy/33719f6bec6b506fb3a821096920c076 to your computer and use it in GitHub Desktop.
function identity(row, emit) {
emit({ y: row.x });
}
bigquery.defineFunction(
'identity',
['x'],
[{ 'name': 'y', 'type': 'float' }],
identity
);
SELECT y FROM identity(
SELECT 21 as x
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment