Packages

o

ca.dataedu.savro

AvroSchema

object AvroSchema

A set of constructors to generate Avro schema

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AvroSchema
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val FloatingPointPattern: Regex
  5. def apply(json: Json): Either[AvroSchemaJsonError, Schema]
  6. def apply(json: Json, name: String, namespace: Option[String]): Either[SAvroError, Schema]

    Infer an Avro schema from a JSON object.

    Infer an Avro schema from a JSON object. It only accepts an object or an array of objects. In any cases, the output is the Avro schema of a record. If the input is an array of objects, then generated schema will try to match with all the objects.

  7. def apply(json: String, name: String, namespace: Option[String]): Either[SAvroError, Schema]
  8. def apply(idl: String, namespace: String, recordName: String): Schema
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def inferArray(json: Json, name: String, namespace: Option[String]): Either[IllegalJsonInput, Schema]

    Assuming that the input JSON is an array, it will take the first element and infers the schema as array of that type.

    Assuming that the input JSON is an array, it will take the first element and infers the schema as array of that type. If the array is empty, it will return array of "null". If the value is not an array, it will return an error.

  17. def inferRecord(jsonObject: JsonObject, name: String, nameSpace: Option[String]): Either[IllegalJsonInput, Schema]

    Tries to create the schema for the input JSON object as a RECORD.

    Tries to create the schema for the input JSON object as a RECORD. First, it will sanitize the field names to be compatible with Avro standard. Then, creates the schema for each field value and accumulates them in one and returns it.

    jsonObject

    the input JSON object

    name

    the name of the object. It will makes sue that the first letter is capital

    nameSpace

    an optional namespace to add to the record. If not provided, it will use empty string

    returns

    the schema corresponding to the input JSON or an error if the input JSON is not an object ot it fails to infer the schema of any field

  18. def inferRecord(json: Json, name: String, nameSpace: Option[String]): Either[IllegalJsonInput, Schema]

    Tries to create the schema for the input JSON object as a RECORD.

    Tries to create the schema for the input JSON object as a RECORD. First, it will sanitize the field names to be compatible with Avro standard. Then, creates the schema for each field value and accumulates them in one and returns it.

    json

    the input JSON object

    name

    the name of the object. It will makes sue that the first letter is capital

    nameSpace

    an optional namespace to add to the record. If not provided, it will use empty string

    returns

    the schema corresponding to the input JSON or an error if the input JSON is not an object ot it fails to infer the schema of any field

  19. def inferRecordFromArray(jsonObjects: Vector[Json], name: String, namespace: Option[String]): Either[SAvroError, Schema]

    Infer Avro schema from an array of JSON objects.

    Infer Avro schema from an array of JSON objects. The final result should accept all the input objects normally using UNION and optional fields

  20. def inferSchema(json: Json, name: String, namespace: Option[String], isArrayItem: Boolean): Either[IllegalJsonInput, Schema]
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def mergeRecordSchema(left: Schema, right: Schema): Schema

    Merges the fields of the right side into the fields of the left side.

    Merges the fields of the right side into the fields of the left side. It will keep the union of the fields and makes sure the fields with the same name maintain compatible schema

    left

    the base record

    right

    the new record to be merged with the base record

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped