在 Google 数据流模板中添加对 JS UDF 的支持
Adding support for JS UDF in Google Dataflow template
我有 this code 来自 Google 云平台数据流模板。
我希望为其添加更多功能,即我希望添加对 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
标志。
example at the top is wrong. You have to pass --inputTopic
instead of --topic
. You can see this in the code其中ValueProvider
的定义:
@Description("The Cloud Pub/Sub topic to read from.")
@Required
ValueProvider<String> getInputTopic();
void setInputTopic(ValueProvider<String> value);
您还可以 运行 来自 Console UI 的模板,工作详细信息将显示该选项确实是 inputTopic
:
javadoc 中的调用示例现在应该反映正确的输入参数 (--inputTopic) here。
我有 this code 来自 Google 云平台数据流模板。
我希望为其添加更多功能,即我希望添加对 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
标志。
example at the top is wrong. You have to pass --inputTopic
instead of --topic
. You can see this in the code其中ValueProvider
的定义:
@Description("The Cloud Pub/Sub topic to read from.")
@Required
ValueProvider<String> getInputTopic();
void setInputTopic(ValueProvider<String> value);
您还可以 运行 来自 Console UI 的模板,工作详细信息将显示该选项确实是 inputTopic
:
javadoc 中的调用示例现在应该反映正确的输入参数 (--inputTopic) here。