title: How to read a JSON file using Apache beam parDo function in Java
body: <p>I am new to Apache beam. As per our requirement I need to pass a JSON file containing five to 10 JSON records as input and read this JSON data from the file line by line and store into BigQuery. Can anyone please help me with my sample code below which tries to read JSON data using apache beam:</p>
  
  <pre><code>PCollection&lt;String&gt; lines = 
      pipeline
        .apply("ReadMyFile", 
               TextIO.read()
                     .from("C:\\Users\\Desktop\\test.json")); 
  if(null!=lines) { 
    PCollection&lt;String&gt; words =
       lines.apply(ParDo.of(new DoFn&lt;String, String&gt;() { 
          @ProcessElement
          public void processElement(ProcessContext c) { 
            String line = c.element();
          }
        })); 
    pipeline.run(); 
  }
  </code></pre>