title: Apache Beam Getting CSV Files from Pub/Sub JSON
body: <p>I have csv files being pushed to Google Storage and a pubsub subscription that notifies me when they arrive. What I'm trying to accomplish is writting a beam program that will grab the JSON data from the pubsub subscription parse out the file location and then read the csv file from GS and then process those. I have a process that will process read the pubsub and then process it into a pcollection. So far I have this:</p>
  
  <pre><code>Options options = PipelineOptionsFactory.fromArgs(args).withValidation().as(Options.class);
  final String output = options.getOutput();
  Pipeline pipeline = Pipeline.create(options);
  
  PCollection&lt;String&gt; input = pipeline.apply(PubsubIO.readStrings().fromSubscription(StaticValueProvider.of("beamsub")));
  
  
    PCollection&lt;String&gt; files = input.apply(ParDo.of(new ParseOutGSFiles()));
  </code></pre>
  
  <p>now i need to do something like this:</p>
  
  <pre><code>pipeline.apply("ReadLines", TextIO.read().from(FILEsFROMEARLIER).withCompressionType(TextIO.CompressionType.GZIP))
  </code></pre>
  
  <p>any ideas or is this not possible...it seems like it should be easy </p>
  
  <p>Thanks in advance</p>