GoogleCloudPlatform / DataflowJavaSDK

Google Cloud Dataflow provides a simple, powerful model for building both batch and streaming parallel data processing pipelines.
http://cloud.google.com/dataflow
855 stars 324 forks source link

Running a jar file from cloud function #583

Closed kpr6 closed 3 years ago

kpr6 commented 7 years ago

So, I wrote a cloud function for cloud storage trigger to run a .jar file as shown


const child = spawn(
            'jre/bin/java',
            ['-jar',
             'TupleNoTemplate.jar',
             '--project = rwa-tooling',
             '--inputFile="gs://cdw-data/CUSTOMER_CDW_V1_20170103.csv" ',
             '--tableName="rwa-tooling:ZZZ_Team_Sandbox_Dataset.CDW_CUSTOMER2$20170103" ',
             '--columns="gs://rwa_bucket1/columns.txt" ',
             '--schema="gs://cdw-data/CUSTOMER_CDW_schema.txt" '
            ],
            { cwd: __dirname });```

But it gives out the following error: 

D      dataflow  129834524734723  2017-06-14 09:32:44.764  Function execution started
I      dataflow  129834524734723  2017-06-14 09:32:45.365  File abc.txt metadata updated.
E      dataflow  129834524734723  2017-06-14 09:32:45.560  error: jre/bin/java: 1: jre/bin/java:
D      dataflow  129834524734723  2017-06-14 09:32:45.560  Function execution took 797 ms, finished with status: 'ok'
D      dataflow  129834524734723  2017-06-14 09:32:45.564  Ignoring exception from a finished function
E      dataflow  129834524734723  2017-06-14 09:32:45.567  error: Syntax error: "(" unexpected
D      dataflow  129834524734723  2017-06-14 09:32:45.567  Ignoring exception from a finished
function
E      dataflow  129834524734723  2017-06-14 09:32:45.569  error:
D      dataflow  129834524734723  2017-06-14 09:32:45.569  Ignoring exception from a finished function
I      dataflow  129834524734723  2017-06-14 09:32:45.655  closing code: 2

java path looks okay, jre folder is in the same directory, am i missing something here?