You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Michael Armbrust <mi...@databricks.com> on 2015/03/14 21:58:17 UTC
Re: How to create data frame from an avro file in Spark 1.3.0
We will be publishing a new version of the library early next week. Here's
the PR for the upgraded version if you would like to build from source:
https://github.com/databricks/spark-avro/pull/33
On Sat, Mar 14, 2015 at 1:17 PM, Shing Hing Man <ma...@yahoo.com.invalid>
wrote:
> In spark-avro 0.1, the method AvroContext.avroFile returns a SchemaRDD,
> which is deprecated in Spark 1.3.0
>
> package com.databricks.spark
>
> import org.apache.spark.sql.{SQLContext, SchemaRDD}
>
> package object avro {
>
> /**
> * Adds a method, `avroFile`, to SQLContext that allows reading data
> stored in Avro.
> */
> implicit class AvroContext(sqlContext: SQLContext) {
> def avroFile(filePath: String) =
>
> sqlContext.baseRelationToSchemaRDD(AvroRelation(filePath)(sqlContext))
> }
> }
>
> Is there a new version of spark-avro, so that AvroContext.avroFile
> returns a DataFrame ?
> In github, spark-avro is still in version 0.1 .
>
> <https://github.com/databricks/spark-avro>
> databricks/spark-avro <https://github.com/databricks/spark-avro>
>
>
>
> [image: image] <https://github.com/databricks/spark-avro>
>
>
>
>
>
> databricks/spark-avro <https://github.com/databricks/spark-avro>
> spark-avro - Integration utilities for using Spark with Apache Avro data
> View on github.com <https://github.com/databricks/spark-avro>
> Preview by Yahoo
>
> Thanks in advance for your assistance !
>
> Shing
>
>
>