stankiewicz commented on code in PR #38490:
URL: https://github.com/apache/beam/pull/38490#discussion_r3274431349


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java:
##########
@@ -188,6 +189,25 @@ public abstract class WindowedContext {
      */
     public abstract void outputWithTimestamp(OutputT output, Instant 
timestamp);
 
+    /**
+     * Adds the given element to the main output {@code PCollection}, with the 
given {@link
+     * ValueKind}.
+     *
+     * <p>Once passed to {@code outputWithKind} the element should not be 
modified in any way.
+     *
+     * <p>If invoked from {@link ProcessElement}, the output element will have 
the same windowing
+     * metadata as the input element.
+     *
+     * <p>If invoked from {@link StartBundle} or {@link FinishBundle}, this 
will attempt to use the
+     * {@link org.apache.beam.sdk.transforms.windowing.WindowFn} of the input 
{@code PCollection} to
+     * determine what windows the element should be in, throwing an exception 
if the {@code
+     * WindowFn} attempts to access any information about the input element.
+     *
+     * <p><i>Note:</i> A splittable {@link DoFn} is not allowed to output from 
{@link StartBundle}
+     * or {@link FinishBundle} methods.
+     */
+    public abstract void outputWithKind(OutputT output, ValueKind kind);

Review Comment:
   I don't think we want to add this. We want user to use OutputBuilder 
interface to avoid adding each outputWithX 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to