@Override public PCollection<Struct> expand(PCollection<ReadOperation> input) { PTransform<PCollection<ReadOperation>, PCollection<Struct>> readTransform; if (getBatching()) { readTransform = BatchSpannerRead.create(getSpannerConfig(), getTransaction(), getTimestampBound()); } else { readTransform = NaiveSpannerRead.create(getSpannerConfig(), getTransaction(), getTimestampBound()); } return input .apply("Reshuffle", Reshuffle.viaRandomKey()) .apply("Read from Cloud Spanner", readTransform); } }