mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 09:27:16 +02:00
Do not include transactions with zero unit price in invoice
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=215611195
This commit is contained in:
parent
4a9b715020
commit
e3a35f0aa0
2 changed files with 3 additions and 3 deletions
|
@ -34,6 +34,7 @@ import org.apache.beam.sdk.options.PipelineOptionsFactory;
|
|||
import org.apache.beam.sdk.options.ValueProvider;
|
||||
import org.apache.beam.sdk.options.ValueProvider.NestedValueProvider;
|
||||
import org.apache.beam.sdk.transforms.Count;
|
||||
import org.apache.beam.sdk.transforms.Filter;
|
||||
import org.apache.beam.sdk.transforms.MapElements;
|
||||
import org.apache.beam.sdk.transforms.PTransform;
|
||||
import org.apache.beam.sdk.values.KV;
|
||||
|
@ -141,6 +142,7 @@ public class InvoicingPipeline implements Serializable {
|
|||
"Map to invoicing key",
|
||||
MapElements.into(TypeDescriptor.of(InvoiceGroupingKey.class))
|
||||
.via(BillingEvent::getInvoiceGroupingKey))
|
||||
.apply(Filter.by((InvoiceGroupingKey key) -> key.unitPrice() != 0))
|
||||
.setCoder(new InvoiceGroupingKeyCoder())
|
||||
.apply("Count occurrences", Count.perElement())
|
||||
.apply(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue