nvm use
npm install
Before push this code to Github (Please run)
npm run lint
To run unit tests:
npm run test
To run the distribution asset tests:
npm run build
npm run test:dist
This requires your terminal to be authenticated with the GCloud SDK
export DEST_BUCKET=your_bucket_name
export GCP_PROJECT=your_project_gcp_id
npm run build
npm run deploy
To Create UDF Function on A Dataset Bigquery
CREATE FUNCTION `${dataset_name}`.stringFormatter(input STRING)
RETURNS STRING
LANGUAGE js
OPTIONS (
library=["gs://js-udfs/bigquery-js-udf-example/dist/dist.js"]
)
AS r"""
return stringFormatter.format(input);
"""
;
SELECT `${dataset_name}`.stringFormatter("I am Tuan Cam ") AS result;