title: Read Avro with Spark in java
body: <p>Can somebody share example of reading avro using java in spark?
  Found scala examples but no luck with java.
  Here is the code snippet which is part of code but running into compilation issues with the method  <code>ctx.newAPIHadoopFile</code>.</p>
  
  <pre><code>JavaSparkContext ctx = new JavaSparkContext(sparkConf);
  Configuration hadoopConf = new Configuration();
  JavaRDD&lt;SampleAvro&gt; lines = ctx.newAPIHadoopFile(path, AvroInputFormat.class, AvroKey.class, NullWritable.class, new Configuration());
  </code></pre>
  
  <p>Regards</p>