-
Notifications
You must be signed in to change notification settings - Fork 641
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Hello,
I am trying to use AWS lambda function to read off Kinesis stream and insert into Google Big Query.
It appears to work fine locally (on my mac) but when I deploy this to AWS and execute as AWS lambda function, I run into initialisation error
error stack:
module initialization error: Error at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/task/node_modules/gcloud/node_modules/grpc/src/node/src/grpc_extension.js:40:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
Appears to be failing to invoke this
gcloud/node_modules/grpc/src/node/extension_binary/grpc_node.node
Below is the sample code
Sample code:
var gcloud = require('gcloud');
module.exports.handler = function(event, context, cb) {
var bigquery = gcloud.bigquery({
projectId: process.env.GCLOUD_PROJECT_ID,
keyFilename: './keys.json'
});
event.Records.forEach(function(record) {
// Kinesis data is base64 encoded so decode here
var payload = new Buffer(record.kinesis.data, 'base64').toString('ascii');
console.log('Decoded payload:', payload);
});
cb(null, "message");
};Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.