apache-beam

Apache Beam Counter/Metrics not available in Flink WebUI

时光怂恿深爱的人放手 提交于 2019-12-06 20:29:32
问题 I'm using Flink 1.4.1 and Beam 2.3.0, and would like to know is it possible to have metrics available in Flink WebUI (or anywhere at all), as in Dataflow WebUI ? I've used counter like: import org.apache.beam.sdk.metrics.Counter; import org.apache.beam.sdk.metrics.Metrics; ... Counter elementsRead = Metrics.counter(getClass(), "elements_read"); ... elementsRead.inc(); but I can't find "elements_read" counts available anywhere (Task Metrics or Accumulators) in Flink WebUI. I thought this will

Close window after based on element value

不羁岁月 提交于 2019-12-06 19:10:43
Is there a way to close a window when an input element has a flag value in the side output of a DoFn? E.g. event which indicates closing of a session closes the window. I've been reading the docs, and triggers are time based mostly. An example would be great. Edit: Trigger.OnElementContext.forTrigger(ExecutableTrigger trigger) seems promising but ExecutableTrigger docs are pretty slim at the moment. I don't think that this is available. There is only one Data Driven Trigger right now, elementCountAtLeast. https://cloud.google.com/dataflow/model/triggers#data-driven-triggers A work around for

Pre Processing Data for Tensorflow: InvalidArgumentError

一笑奈何 提交于 2019-12-06 16:53:27
When I run my tensorflow model I am receiving this error InvalidArgumentError: Field 4 in record 0 is not a valid float: latency [[Node: DecodeCSV = DecodeCSV[OUT_TYPE=[DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING], field_delim=",", na_value="", use_quote_delim=true](arg0, DecodeCSV/record_defaults_0, DecodeCSV/record_defaults_1, DecodeCSV/record_defaults_2, DecodeCSV/record_defaults_3, DecodeCSV/record_defaults_4, DecodeCSV/record_defaults_5, DecodeCSV/record_defaults_6, DecodeCSV/record

Parallelism Problem on Cloud Dataflow using Go SDK

冷暖自知 提交于 2019-12-06 16:10:52
I have Apache Beam code implementation on Go SDK as described below. The pipeline has 3 steps. One is textio.Read , other one is CountLines and the last step is ProcessLines . ProcessLines step takes around 10 seconds time. I just added a Sleep function for the sake of brevity. I am calling the pipeline with 20 workers. When I run the pipeline, my expectation was 20 workers would run in parallel and textio.Read read 20 lines from the file and ProcessLines would do 20 parallel executions in 10 seconds. However, the pipeline did not work like that. It's currently working in a way that textio

Error creating dataflow template with TextIO and ValueProvider

烂漫一生 提交于 2019-12-06 15:02:52
问题 I am trying to create a google dataflow template but I can't seem to find a way to do it without producing the following exception: WARNING: Size estimation of the source failed: RuntimeValueProvider{propertyName=inputFile, default=null} java.lang.IllegalStateException: Value only available at runtime, but accessed from a non-runtime context: RuntimeValueProvider{propertyName=inputFile, default=null} at org.apache.beam.sdk.options.ValueProvider$RuntimeValueProvider.get(ValueProvider.java:234)

Python Apache Beam Side Input Assertion Error

三世轮回 提交于 2019-12-06 13:40:34
I am still new to Apache Beam/Cloud Dataflow so I apologize if my understanding is not correct. I am trying to read a data file, ~30,000 rows long, through a pipeline. My simple pipeline first opened the csv from GCS, pulled the headers out of the data, ran the data through a ParDo/DoFn function, and then wrote all of the output into a csv back into GCS. This pipeline worked and was my first test. I then edited the pipeline to read the csv, pull out the headers, remove the headers from the data, run the data through the ParDo/DoFn function with the headers as a side input, and then write all

How to retrieve the content of a PCollection and assign it to a normal variable?

折月煮酒 提交于 2019-12-06 13:31:41
I am using Apache-Beam with the Python SDK. Currently, my pipeline reads multiple files, parse them and generate pandas dataframes from its data. Then, it groups them into a single dataframe. What I want now is to retrieve this single fat dataframe, assigning it to a normal Python variable. Is it possible to do? PCollection is simply a logical node in the execution graph and its contents are not necessarily actually stored anywhere, so this is not possible directly. However, you can ask your pipeline to write the PCollection to a file (e.g. convert elements to strings and use WriteToText with

Optimizing repeated transformations in Apache Beam/DataFlow

限于喜欢 提交于 2019-12-06 13:23:29
I wonder if Apache Beam.Google DataFlow is smart enough to recognize repeated transformations in the dataflow graph and run them only once. For example, if I have 2 branches: p | GroupByKey() | FlatMap(...) p | combiners.Top.PerKey(...) | FlatMap(...) both will involve grouping elements by key under the hood. Will the execution engine recognize that GroupByKey() has the same input in both cases and run it only once? Or do I need to manually ensure that GroupByKey() in this case proceeds all branches where it gets used? As you may have inferred, this behavior is runner-dependent. Each runner

Unable to Write to bigquery - Permission denied: Apache Beam Python - Google Dataflow

六眼飞鱼酱① 提交于 2019-12-06 11:06:09
问题 I have been using apache beam python sdk using google cloud dataflow service for quite some time now. I was setting dataflow up for a new project. The dataflow pipeline Reads data from google datastore Processes it Writes to Google Big-Query. I have similar pipelines running on other projects which are running perfectly fine. Today, When I started a dataflow job, the pipeline started, read data from datastore, processed it and when it was about to write it to bigquery, It resulted in apache

Python + Beam + Flink

早过忘川 提交于 2019-12-06 10:35:22
I've been trying to get the Apache Beam Portability Framework to work with Python and Apache Flink and I can't seem to find a complete set of instructions to get the environment working. Are there any references with complete list of prerequisites and steps to get a simple python pipeline working? Overall, for local portable runner (ULR), see the wiki , quote from there: Run a Python-SDK Pipeline: Compile container as a local build: ./gradlew :beam-sdks-python-container:docker Start ULR job server, for example: ./gradlew :beam-runners-reference-job-server:run -PlogLevel=debug -PvendorLogLevel