Class FilterExamples
- java.lang.Object
-
- org.apache.beam.examples.cookbook.FilterExamples
-
public class FilterExamples extends java.lang.ObjectThis is an example that demonstrates several approaches to filtering, and use of the Mean transform. It shows how to dynamically set parameters by defining and using new pipeline options, and how to use a value derived by the pipeline.Concepts: The Mean transform; Options configuration; using pipeline-derived data as a side input; approaches to filtering, selection, and projection.
The example reads public samples of weather data from BigQuery. It performs a projection on the data, finds the global mean of the temperature readings, filters on readings for a single given month, and then outputs only data (for that month) that has a mean temp smaller than the derived global mean.
Note: Before running this example, you must create a BigQuery dataset to contain your output table.
To execute this pipeline locally, specify the BigQuery table for the output:
where optional parameter--output=YOUR_PROJECT_ID:DATASET_ID.TABLE_ID [--monthFilter=<month_number>]--monthFilteris set to a number 1-12.To change the runner, specify:
See examples/java/README.md for instructions about how to configure different runners.--runner=YOUR_SELECTED_RUNNERThe BigQuery input table defaults to
apache-beam-testing.samples.weather_stationsand can be overridden with--input.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFilterExamples.OptionsOptions supported byFilterExamples.
-
Constructor Summary
Constructors Constructor Description FilterExamples()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)
-