I'm new to user-defined UDFs, so please bear with me if this question seems basic.
Is it possible to use a standard http library to make a request FROM a BigQuery function?
Essentially, I want to create a function that can be accessed from SQL and will trigger an external service via http.
I've attempted to import and require the http library in my custom function, but both have failed when running the Javascript in BigQuery.
'use strict';
function https(){
let res = '';
http = require('http');
http.get('https://google.com'), (resp) => {
let data = "";
resp.on('end', () => {
res = "pinged";
});
};
return res;
};
Thank you in advance!