Skip to content

Commit

Permalink
Make AvroSchema.schema a def
Browse files Browse the repository at this point in the history
  • Loading branch information
espringe committed Nov 8, 2012
1 parent 7e1f0dd commit 407b5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/avroUsage/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ scalaVersion := "2.9.2"

scalacOptions ++= Seq("-Ydependent-method-types", "-deprecation")

libraryDependencies += "com.nicta" %% "scoobi" % "0.6.1-cdh3-SNAPSHOT"
libraryDependencies += "com.nicta" %% "scoobi" % "0.6.0-cdh3-SNAPSHOT"



6 changes: 3 additions & 3 deletions src/main/scala/com/nicta/scoobi/io/avro/AvroSchema.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import core._
/** Defines the Avro schema for a given Scala type. */
trait AvroSchema[A] {
type AvroType
val schema: Schema
def schema: Schema
def fromAvro(x: AvroType): A
def toAvro(x: A): AvroType
}
Expand Down Expand Up @@ -354,8 +354,8 @@ object AvroSchema {
/* Actual Avro Generic/SpecificRecord support */
implicit def AvroRecordSchema[T <: GenericContainer](implicit r : Manifest[T]) = new AvroSchema[T] {
val sclass = r.erasure.asInstanceOf[Class[T]]
val record = sclass.newInstance
val schema : Schema = record.getSchema
def record = sclass.newInstance
def schema : Schema = record.getSchema
type AvroType = T
def fromAvro(x : T) : T = x
def toAvro(x: T) : T = x
Expand Down

1 comment on commit 407b5c9

@ccsevers
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great!

Please sign in to comment.