[ https://issues.apache.org/jira/browse/BEAM-2939?focusedWorklogId=399918&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-399918 ]
ASF GitHub Bot logged work on BEAM-2939: ---------------------------------------- Author: ASF GitHub Bot Created on: 08/Mar/20 21:39 Start Date: 08/Mar/20 21:39 Worklog Time Spent: 10m Work Description: iemejia commented on pull request #11065: [BEAM-2939, BEAM-9458] Add deduplication transform URL: https://github.com/apache/beam/pull/11065#discussion_r389407728 ########## File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Deduplicate.java ########## @@ -0,0 +1,325 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.transforms; + +import javax.annotation.Nullable; +import org.apache.beam.sdk.coders.BooleanCoder; +import org.apache.beam.sdk.coders.Coder; +import org.apache.beam.sdk.coders.KvCoder; +import org.apache.beam.sdk.state.StateSpec; +import org.apache.beam.sdk.state.StateSpecs; +import org.apache.beam.sdk.state.TimeDomain; +import org.apache.beam.sdk.state.Timer; +import org.apache.beam.sdk.state.TimerSpec; +import org.apache.beam.sdk.state.TimerSpecs; +import org.apache.beam.sdk.state.ValueState; +import org.apache.beam.sdk.values.KV; +import org.apache.beam.sdk.values.PCollection; +import org.apache.beam.sdk.values.TypeDescriptor; +import org.joda.time.Duration; + +/** + * A set of {@link PTransform}s which deduplicate input records over a time domain and threshold. + * Values in different windows will not be considered duplicates of each other. Deduplication is + * best effort. + * + * <p>Two values of type {@code T} are compared for equality <b>not</b> by regular Java {@link + * Object#equals}, but instead by first encoding each of the elements using the {@code + * PCollection}'s {@code Coder}, and then comparing the encoded bytes. This admits efficient + * parallel evaluation. + * + * <p>These PTransforms are different then {@link Distinct} since {@link Distinct} guarantees + * uniqueness of values within a {@link PCollection} but may support a narrower set of {@link + * org.apache.beam.sdk.values.WindowingStrategy windowing strategies} or may delay when output is + * produced. + * + * <p>The durations specified may impose memory and/or storage requirements within a runner and care + * might need to be used to ensure that the deduplication time limit is long enough to remove + * duplicates but short enough to not cause performance problems within a runner. Each runner may + * provide an optimized implementation of their choice using the deduplication time domain and + * threshold specified. + * + * <p>Does not preserve any order the input PCollection might have had. + * + * <p>Example of use: + * + * <pre>{@code + * PCollection<String> words = ...; + * PCollection<String> deduplicatedWords = + * words.apply(Deduplicate.<String>values()); + * }</pre> + */ +public final class Deduplicate { Review comment: @lukecwik Maybe we should mark this one as `@Experimental` for the moment specially since it is coming directly to core. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 399918) Time Spent: 24h 10m (was: 24h) > Fn API SDF support > ------------------ > > Key: BEAM-2939 > URL: https://issues.apache.org/jira/browse/BEAM-2939 > Project: Beam > Issue Type: Improvement > Components: beam-model > Reporter: Henning Rohde > Assignee: Luke Cwik > Priority: Major > Labels: portability > Time Spent: 24h 10m > Remaining Estimate: 0h > > The Fn API should support streaming SDF. Detailed design TBD. > Once design is ready, expand subtasks similarly to BEAM-2822. -- This message was sent by Atlassian Jira (v8.3.4#803005)