/** * Creates the transform for a {@link ParDo}-compatible {@link AppliedPTransform}. * * <p>The input may generally be a deserialized transform so it may not actually be a {@link * ParDo}. Instead {@link ParDoTranslation} will be used to extract fields. */ @SuppressWarnings({"unchecked", "rawtypes"}) public static <InputT, OutputT> SplittableParDo<InputT, OutputT, ?> forAppliedParDo( AppliedPTransform<PCollection<InputT>, PCollectionTuple, ?> parDo) { checkArgument(parDo != null, "parDo must not be null"); try { Map<TupleTag<?>, Coder<?>> outputTagsToCoders = Maps.newHashMap(); for (Map.Entry<TupleTag<?>, PValue> entry : parDo.getOutputs().entrySet()) { outputTagsToCoders.put(entry.getKey(), ((PCollection) entry.getValue()).getCoder()); } return new SplittableParDo( ParDoTranslation.getDoFn(parDo), ParDoTranslation.getSideInputs(parDo), ParDoTranslation.getMainOutputTag(parDo), ParDoTranslation.getAdditionalOutputTags(parDo), outputTagsToCoders); } catch (IOException exc) { throw new RuntimeException(exc); } }
sideInputs = ParDoTranslation.getSideInputs(context.getCurrentTransform()); } catch (IOException e) { throw new RuntimeException(e);
sideInputs = ParDoTranslation.getSideInputs(context.getCurrentTransform()); } catch (IOException e) { throw new RuntimeException(e);
sideInputs = ParDoTranslation.getSideInputs(context.getCurrentTransform()); } catch (IOException e) { throw new RuntimeException(e);
sideInputs = ParDoTranslation.getSideInputs(context.getCurrentTransform()); } catch (IOException e) { throw new RuntimeException(e);