Skip to content

Commit

Permalink
[fix] docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancamtbtx committed Jan 2, 2024
1 parent 9ae9768 commit 6dda645
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Google BigQuery Javascript UDF Function Examples
![Google Badge](https://img.shields.io/badge/GoogleCloud-4285F4?style=for-the-badge&labelColor=black&logo=Google%20Cloud&logoColor=white)


## Progaming language
![Nodejs Badge](https://img.shields.io/badge/-Nodejs-3C873A?style=for-the-badge&labelColor=black&logo=node.js&logoColor=3C873A)

## Install

Expand Down Expand Up @@ -42,16 +44,16 @@ npm run deploy

*To Create UDF Function on A Dataset Bigquery*
```
CREATE FUNCTION `${dataset_name}`.phoneNumberFormat(input STRING, code STRING, formatType STRING)
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 PhoneNumberFormatter.format(input, code, formatType);
return stringFormatter.format(input);
"""
;
SELECT `${dataset_name}`.phoneNumberFormat("0387902375", "VN", "E164") AS result;
SELECT `${dataset_name}`.stringFormatter("I am Tuan Cam ") AS result;
```

0 comments on commit 6dda645

Please sign in to comment.