Using NPM Library in Google BigQuery UDF

Javascript UDF’s are cool and using with NPM library is a whole new world to explore!

Suraj Mishra
Analytics Vidhya

--

Originally published at https://asyncq.com

Background

One of the main reason to build ETL pipeline was to do data transformation on data before loading into the data warehouse. The only reason we were doing that because data warehouses were not capable to handle these data transformations due to several reasons such as performance and flexibility.

In the era of modern data warehouses like Google BigQuery or SnowFlake, things have changed. These data warehouses can process terabyte and petabyte data within seconds and minutes. Considering this much improvement, now performing data transformation within a data warehouse make more sense. Hence to create common transformation logic via UDF (user-defined functions). In this blog, we will see how can we utilize the power of javascript UDF and NPM library to generate data in BigQuery.

What is UDF?

From Google Cloud Documentations:

A user-defined function (UDF) lets you create a function by using a SQL expression or JavaScript code. A UDF accepts columns of input, performs actions on the input, and returns the result of those…

--

--

Suraj Mishra
Analytics Vidhya

Staff Software Engineer @PayPal ( All opinions are my own and not of my employer )