Code review comment: yeah agree, ideally. Just not confident enough and want to keep the change limited to what necessary to fix bug (though change is already not minor)

Code under review:
public WriteResult expandUntriggered(PCollection<KV<DestinationT, ElementT>> input) {
    Pipeline p = input.getPipeline();
    final PCollectionView<String> loadJobIdPrefixView = createJobIdPrefixView(p, JobType.LOAD);
    final PCollectionView<String> tempLoadJobIdPrefixView =
        createJobIdPrefixView(p, JobType.TEMP_TABLE_LOAD);
    final PCollectionView<String> zeroLoadJobIdPrefixView =
        createJobIdPrefixView(p, JobType.ZERO_LOAD);
    final PCollectionView<String> copyJobIdPrefixView = createJobIdPrefixView(p, JobType.COPY);
    final PCollectionView<String> tempFilePrefixView =
        createTempFilePrefixView(p, loadJobIdPrefixView);
    PCollection<KV<DestinationT, ElementT>> inputInGlobalWindow =
        input.apply(
            "rewindowIntoGlobal",
            Window.<KV<DestinationT, ElementT>>into(new GlobalWindows())
                .triggering(DefaultTrigger.of())
                .discardingFiredPanes());
    PCollection<WriteBundlesToFiles.Result<DestinationT>> results =
        (numFileShards == 0)
            ? writeDynamicallyShardedFilesUntriggered(inputInGlobalWindow, tempFilePrefixView)
            : writeStaticallyShardedFiles(inputInGlobalWindow, tempFilePrefixView);

    TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>> multiPartitionsTag =
        new TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>>("multiPartitionsTag") {};
    TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>> singlePartitionTag =
        new TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>>("singlePartitionTag") {};

    
    
    
    PCollectionTuple partitions =
        results
            .apply("ReifyResults", new ReifyAsIterable<>())
            .setCoder(IterableCoder.of(WriteBundlesToFiles.ResultCoder.of(destinationCoder)))
            .apply(
                "WritePartitionUntriggered",
                ParDo.of(
                        new WritePartition<>(
                            singletonTable,
                            dynamicDestinations,
                            tempFilePrefixView,
                            maxFilesPerPartition,
                            maxBytesPerPartition,
                            multiPartitionsTag,
                            singlePartitionTag,
                            rowWriterFactory))
                    .withSideInputs(tempFilePrefixView)
                    .withOutputTags(multiPartitionsTag, TupleTagList.of(singlePartitionTag)));

    PCollection<TableDestination> successfulSinglePartitionWrites =
        writeSinglePartition(partitions.get(singlePartitionTag), loadJobIdPrefixView);

    List<PCollectionView<?>> sideInputsForUpdateSchema =
        Lists.newArrayList(zeroLoadJobIdPrefixView);
    sideInputsForUpdateSchema.addAll(dynamicDestinations.getSideInputs());

    PCollection<TableDestination> successfulMultiPartitionWrites =
        writeTempTables(partitions.get(multiPartitionsTag), tempLoadJobIdPrefixView)
            .apply("ReifyRenameInput", new ReifyAsIterable<>())
            .apply(
                ParDo.of(
                        new UpdateSchemaDestination<DestinationT>(
                            bigQueryServices,
                            zeroLoadJobIdPrefixView,
                            loadJobProjectId,
                            WriteDisposition.WRITE_APPEND,
                            CreateDisposition.CREATE_NEVER,
                            maxRetryJobs,
                            kmsKey,
                            schemaUpdateOptions,
                            destinationsWithMatching))
                    .withSideInputs(sideInputsForUpdateSchema))
            .apply(
                "WriteRenameUntriggered",
                ParDo.of(
                        new WriteRename(
                            bigQueryServices,
                            copyJobIdPrefixView,
                            writeDisposition,
                            createDisposition,
                            maxRetryJobs,
                            kmsKey,
                            loadJobProjectId))
                    .withSideInputs(copyJobIdPrefixView))
            .setCoder(tableDestinationCoder);

    PCollectionList<TableDestination> allSuccessfulWrites =
        PCollectionList.of(successfulSinglePartitionWrites).and(successfulMultiPartitionWrites);

    return writeResult(p, allSuccessfulWrites.apply(Flatten.pCollections()));
  }

Line commented on: PCollection<TableDestination> successfulMultiPartitionWrites =

Revised code:
public WriteResult expandUntriggered(PCollection<KV<DestinationT, ElementT>> input) {
    Pipeline p = input.getPipeline();
    final PCollectionView<String> loadJobIdPrefixView = createJobIdPrefixView(p, JobType.LOAD);
    final PCollectionView<String> tempLoadJobIdPrefixView =
        createJobIdPrefixView(p, JobType.TEMP_TABLE_LOAD);
    final PCollectionView<String> zeroLoadJobIdPrefixView =
        createJobIdPrefixView(p, JobType.SCHEMA_UPDATE);
    final PCollectionView<String> copyJobIdPrefixView = createJobIdPrefixView(p, JobType.COPY);
    final PCollectionView<String> tempFilePrefixView =
        createTempFilePrefixView(p, loadJobIdPrefixView);
    PCollection<KV<DestinationT, ElementT>> inputInGlobalWindow =
        input.apply(
            "rewindowIntoGlobal",
            Window.<KV<DestinationT, ElementT>>into(new GlobalWindows())
                .triggering(DefaultTrigger.of())
                .discardingFiredPanes());
    PCollection<WriteBundlesToFiles.Result<DestinationT>> results =
        (numFileShards == 0)
            ? writeDynamicallyShardedFilesUntriggered(inputInGlobalWindow, tempFilePrefixView)
            : writeStaticallyShardedFiles(inputInGlobalWindow, tempFilePrefixView);

    TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>> multiPartitionsTag =
        new TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>>("multiPartitionsTag") {};
    TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>> singlePartitionTag =
        new TupleTag<KV<ShardedKey<DestinationT>, WritePartition.Result>>("singlePartitionTag") {};

    
    
    
    PCollectionTuple partitions =
        results
            .apply("ReifyResults", new ReifyAsIterable<>())
            .setCoder(IterableCoder.of(WriteBundlesToFiles.ResultCoder.of(destinationCoder)))
            .apply(
                "WritePartitionUntriggered",
                ParDo.of(
                        new WritePartition<>(
                            singletonTable,
                            dynamicDestinations,
                            tempFilePrefixView,
                            maxFilesPerPartition,
                            maxBytesPerPartition,
                            multiPartitionsTag,
                            singlePartitionTag,
                            rowWriterFactory))
                    .withSideInputs(tempFilePrefixView)
                    .withOutputTags(multiPartitionsTag, TupleTagList.of(singlePartitionTag)));

    PCollection<TableDestination> successfulSinglePartitionWrites =
        writeSinglePartition(partitions.get(singlePartitionTag), loadJobIdPrefixView);

    List<PCollectionView<?>> sideInputsForUpdateSchema =
        Lists.newArrayList(zeroLoadJobIdPrefixView);
    sideInputsForUpdateSchema.addAll(dynamicDestinations.getSideInputs());

    PCollection<TableDestination> successfulMultiPartitionWrites =
        writeTempTables(partitions.get(multiPartitionsTag), tempLoadJobIdPrefixView)
            .apply("ReifyRenameInput", new ReifyAsIterable<>())
            .apply(
                ParDo.of(
                        new UpdateSchemaDestination<DestinationT>(
                            bigQueryServices,
                            zeroLoadJobIdPrefixView,
                            loadJobProjectId,
                            WriteDisposition.WRITE_APPEND,
                            CreateDisposition.CREATE_NEVER,
                            maxRetryJobs,
                            kmsKey,
                            schemaUpdateOptions,
                            destinationsWithMatching))
                    .withSideInputs(sideInputsForUpdateSchema))
            .apply(
                "WriteRenameUntriggered",
                ParDo.of(
                        new WriteRename(
                            bigQueryServices,
                            copyJobIdPrefixView,
                            writeDisposition,
                            createDisposition,
                            maxRetryJobs,
                            kmsKey,
                            loadJobProjectId))
                    .withSideInputs(copyJobIdPrefixView))
            .setCoder(tableDestinationCoder);

    PCollectionList<TableDestination> allSuccessfulWrites =
        PCollectionList.of(successfulSinglePartitionWrites).and(successfulMultiPartitionWrites);

    return writeResult(p, allSuccessfulWrites.apply(Flatten.pCollections()));
  }