<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to access file in HDFS from Spark-shell or app with Avro libs? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-access-file-in-HDFS-from-Spark-shell-or-app-with-Avro/m-p/157177#M119584</link>
    <description>&lt;P&gt;Almost forgot about this...&lt;/P&gt;&lt;P&gt;I access my avro files like so:&lt;/P&gt;&lt;P&gt;First as Tim said, include proper avro lib, in my case DataBricks. &lt;/P&gt;&lt;P&gt;spark-submit --packages com.databricks:spark-avro_2.10:2.0.1 --class MyMain MyMain.jar&lt;/P&gt;&lt;P&gt;val df = sqlContext.read.format("com.databricks.spark.avro").
  option("header", "true").load("/user/user1/writer_test.avro")
  df.select("time").show()&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Thanks all&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 09:20:58 GMT</pubDate>
    <dc:creator>mak88</dc:creator>
    <dc:date>2016-09-20T09:20:58Z</dc:date>
  </channel>
</rss>

