-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I am new to running pipeline jobs on the google cloud and I am running to the issue with PubSub to DataQuery. 'mvn clean && mvn compile' worked but the command to create the template fails.
--Command
mvn compile exec:java \ -Dexec.mainClass=com.google.cloud.teleport.templates.PubsubToDatastore \ -Dexec.cleanupDaemonThreads=false \ -Dexec.args=" \ --project=PROJECT_ID \ --pubsubReadTopic=projects/PROJECT_ID/topics/topic \ --javascriptTextTransformGcsPath=gs://PROJECT_ID/*.js. \ --javascriptTextTransformFunctionName=transform \ --stagingLocation=gs://PROJECT_ID/staging \ --tempLocation=gs://PROJECT_ID/temp \ --templateLocation=gs://<PROJECT_ID>/templates/PubSub_to_Datastore.json \ --runner=DataflowRunner"
-- javascript
`/**
- A transform which adds a field to the incoming data.
- @param {string} inJson
- @return {string} outJson
*/
function transform(line) {
var values = line.split(',');
var obj = new Object();
obj._description = values[0];
obj._east = values[1];
obj._last_updt = values[2];
obj._north = values[3];
obj._region_id = values[4];
obj._south = values[5];
obj._west = values[6];
obj.current_speed = values[7];
obj.region = values[8];
var jsonString = JSON.stringify(obj);
return jsonString;
}--Datastore Schema{
"Datastore Schema": [
{
"name": "_description",
"type": "STRING"
},
{
"name": "_east",
"type": "FLOAT"
},
{
"name": "_last_updt",
"type": "TIMESTAMP"
},
{
"name": "_north",
"type": "FLOAT"
},
{
"name": "_region_id",
"type": "INTEGER"
},
{
"name": "_south",
"type": "FLOAT"
},
{
"name": "_west",
"type": "FLOAT"
},
{
"name": "current_speed",
"type": "FLOAT"
},
{
"name": "region",
"type": "STRING"
}
]
}`