簡體   English   中英

在Google Dataflow模板中添加對JS UDF的支持

[英]Adding support for JS UDF in Google Dataflow template

我有來自Google Cloud Platform數據流模板的代碼

我希望為其添加更多功能,即希望添加對JavaScript UDF的支持。 當我嘗試編譯文件時,使用以下命令:

mvn compile exec:java \
-Dexec.mainClass=com.google.cloud.teleport.templates.${PIPELINE_NAME} \
-Dexec.cleanupDaemonThreads=false \
-Dexec.args=" \
--project=${PROJECT_ID} \
--stagingLocation=gs://${PROJECT_ID}/dataflow/${PIPELINE_FOLDER}/staging \
--tempLocation=gs://${PROJECT_ID}/dataflow/${PIPELINE_FOLDER}/temp \
--runner=DataflowRunner \
--windowDuration=2m \
--numShards=1 \
--topic=projects/${PROJECT_ID}/topics/windowed-files \
--outputDirectory=gs://${PROJECT_ID}/temp/ \
--outputFilenamePrefix=windowed-file \
--outputFilenameSuffix=.txt"

編譯文件時,出現以下錯誤:

An exception occured while executing the Java class. Class interface com.google.cloud.teleport.templates.PubsubToText$Options missing a property named 'topic'. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project google-cloud-teleport-java: An exception occured while executing the Java class. Class interface com.google.cloud.teleport.templates.PubsubToText$Options missing a property named 'topic'.

即使,我通過了--topic標志,並插入了適當的值。

頂部的示例是錯誤的。 您必須傳遞--inputTopic而不是--topic 您可以在定義ValueProvider代碼中看到以下內容:

@Description("The Cloud Pub/Sub topic to read from.")
@Required
ValueProvider<String> getInputTopic();
void setInputTopic(ValueProvider<String> value);

您也可以從控制台 UI運行模板,作業詳細信息將顯示該選項確實為inputTopic

在此處輸入圖片說明

現在,javadoc中的調用示例應該在此處反映正確的輸入參數(--inputTopic)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM